Ive read in my excel data and found the max value for each column and calculated the mean from that.
library(readxl)
exp4 <- read_excel("exp4.xlsx")
View(exp4)
this gives you the highest value in the entire datase
maxpeak <- apply(exp4, MARGIN = 2, function(x) max(x, na.rm=TRUE))
maxpeak
#the mean of all the max peaks in this experiment
mean16052019exp4 <- mean(maxpeak)
mean16052019exp4
I've then taken the original max value and subtracted the baseline values using another excel spreadsheet read in BUT when i now want the mean of these new values:
realmaxpeak <- (maxpeak - exp4baseline)
realmaxpeak
#trying to calculate the mean of the baseline adjusted values
View(realmaxpeak)
mean(realmaxpeak)
I get: Warning message:
In mean.default(realmaxpeak[0.1]) : argument is not numeric or logical: returning NA
Why can i not calculate the mean from the vector (realmaxpeak) i created?
TIA
class(realmaxpeak)
? This should address you, with reading?mean
, on what is not going well. – s__