I would like to take the mean of the two vectors below and store the value in vector B2. Note that I am trying to take the mean value by ROW.
When I use:
You want to use
rowMeans(), which produces a vector of the mean of several columns for each row. The input must be an array (i.e., matrix) or data frame.
The code you want is:
cbind() puts the two vectors into an array.