Question

If I have 128 columns (patients) and 1265 rows (genes) of data; example below. How do...

If I have 128 columns (patients) and 1265 rows (genes) of data; example below. How do I calculate the average of each column (128) in R? I need to know how to write the code in R?

> exprs(ALL)
01005 01010 03002 04006 04007
1000_at 7.597323 7.479445 7.567593 7.384684 7.905312
1001_at 5.046194 4.932537 4.799294 4.922627 4.844565
1002_f_at 3.900466 4.208155 3.886169 4.206798 3.416923
1003_s_at 5.903856 6.169024 5.860459 6.116890 5.687997
1004_at 5.925260 5.912780 5.893209 6.170245 5.615210
1005_at 8.570990 10.428299 9.616713 9.937155 9.983809
1006_at 3.656143 3.853979 3.646808 3.874289 3.547361

Homework Answers

Answer #1

There are many ways for calculating average of each column in R.

1.

> colMeans(x=ALL, na.rm = TRUE) # Assuming that your data stored in ALL variable and in dataframe format. IF not run this

> ### Create Data Frame

> ALL=as.data.frame(ALL)

2.

Use summarise in the dplyr package:

library(dplyr)
summarise(ALL, Average = mean(col_name, na.rm = T))

3.

Get Mean of the column by column position

# Get Mean of the column by column position

> mean(ALL[,3])

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
How can I reduce data set by deleting any rows that have all FALSE values for...
How can I reduce data set by deleting any rows that have all FALSE values for every column in that row using pandas. Example: The table data below the pandas code should drop/reduce the data to remove the second & fifth row. Treat The Dtype for the True and False values as object. id Test1 value1 value2 value3 value4 0.1 1 False False False False 0.2 2 False True True False 0.3 3 True False False False 0.4 4 False...
Suppose we have the following data: 0.1876798 0.5425627 0.0000000 0.4680425 0.2812897 0.2763695 -0.2048694 0.4441289   0.0000000 0.5694079...
Suppose we have the following data: 0.1876798 0.5425627 0.0000000 0.4680425 0.2812897 0.2763695 -0.2048694 0.4441289   0.0000000 0.5694079 The data have two columns as above, the first one is beta1 hat the second one is for beta 2 hat. I want R codes to get 0.1876798 0.5425627 0.2812897 0.2763695 -0.2048694 0.4441289   I want R codes to delete the rows that have zeros, and find the average for the first column and second column Note, I want to apply the code for 800...
how to use aov commend in R Studio with only one column of data. the data...
how to use aov commend in R Studio with only one column of data. the data name is temperature for example. I know if there is two column of data i can use like avo(temperature~name, data=temperature), how to do it in one
Sudoku is a puzzle consisting of squares arranged in 9 rows and 9 columns. The 81...
Sudoku is a puzzle consisting of squares arranged in 9 rows and 9 columns. The 81 squares are further divided into nine 3 ✕ 3 square boxes. The object is to fill in the squares with numerals 1 through 9 so that each column, row, and box contains all nine numbers. However, there is a requirement that each number appear only once in any row, column, or box. Each puzzle already has numbers in some of the squares. Alisha wants...
In R studio please explain how to do the stemplot? A sample of 20 endangered species...
In R studio please explain how to do the stemplot? A sample of 20 endangered species was obtained and the length of time (in months) since being placed on the list was recorded for each species. A stemplot of these data follows. In the stemplot, 5|2 represents 52 months. 5   2 4 8 9 9 6   0 0 3 5 6 7 8 9 7   3 4 7 8 9 9 8 9   8 The median length of time (in...
I am using forecast package for time series analysis. I have a dataset with hourly data...
I am using forecast package for time series analysis. I have a dataset with hourly data from oct 3 2016 to oct 23 2016. I used the following code to convert my data into a time series object. Dataset is about citibike stations I’m only using 6 stations I’m not sure if Im supposed to use my time column or include my time column. This is what i have so far. data.ts <- ts(CitiBike[,2:7], freq = 504, start = 2016)...
Microsoft Visual Studio in C#: I have this code and need to loop through each element...
Microsoft Visual Studio in C#: I have this code and need to loop through each element of the patient's array and add to a listbox (lbAccountDisplay) each property of the patient's object. This is the 2nd time to ask this question; it should have all the detail you need to help me. It is a piece of a project and I am trying not to give you the whole project. How do I use a foreach loop to loop through...
I have absolutely no idea where to start with this or even how to do it....
I have absolutely no idea where to start with this or even how to do it. The chart is what is throwing me off. I just need to know how to do this problem, how to start it, and how does the chart even relate to the problem? For variance, you need a mean I guess, how is that possible with the chart? Using the table below, calculate the variance of X, variance of Y, standard deviation of X, standard...
Can you show me how to do this using Excel? Suppose we gathered the data below...
Can you show me how to do this using Excel? Suppose we gathered the data below by an unbiased method.  (The data is sorted DOWN the columns.) 111 116 119 120 123 126 128 131 136 142 115 117 119 120 123 127 129 132 136 142 115 117 120 121 123 127 129 133 138 143 115 118 120 121 123 128 131 133 138 158 116 118 120 123 125 128 131 135 141 163 (4 pts) Use the...
Class-In Assignment 3: Chapters 4&5 How to retrieve data from two or more tables Exercises 1....
Class-In Assignment 3: Chapters 4&5 How to retrieve data from two or more tables Exercises 1. Write a SELECT statement that returns all columns from the Vendors table inner-joined with all columns from the Invoices table. 2. Write a SELECT statement that returns four columns: vendor_name vendor_name from the Vendors table invoice_number invoice_number from the Invoices table invoice_date invoice_date from the Invoices table balance_due invoice_total minus payment_total minus credit_total from the Invoices table The result set should have one row...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT