search for: mean_5

Displaying 1 result from an estimated 1 matches for "mean_5".

Did you mean: mean_
2007 Nov 25
2
rowMean, specify subset of columns within Dataframe?
...t growth over 5 years (I1 through I5) where each tree is a row and each row has 5 columns. So far I have achieved this using rowMeans when all columns are numeric type and used in the calculation: Data1 <- data.frame(cbind(I1 = 3, I2 = c(0,3:1, 2:5,NA), I3 =c(1:4,NA,5:2),I4=2,I5=3)) Data1 Data1$mean_5 <- rowMeans(Data1, na.rm =T) Data1 My real dataset has many columns including several Factor type. Is it possible to specify a range of columns within a data frame using rowMeans dims= (say where there is a one Factor column called Species leading I1 to I5, and one Factor column called Moist...