Question: I get only 'NA' values into my loop - Need to find mean of max CR_Art per Experiment per Mussel
gravatar for jeff.roemer
2.5 years ago by
jeff.roemer0 wrote:

Importing datafile "Raadata.csv" (Headers: Treatment, Mussel, Experiment, Interval, CR_Art, CR_Rho, CHR_Art, FR_C_Art , CHR_Rho, FR_C_Rho). Some fields are empty. Not all treatments have values in all columns. read.csv2 is used because of European standards, I have to convert comma to dot:

Max_CR_FR <- read.csv2(file="Raadata.csv", header=T, sep=";",skipNul=TRUE)

Grouping data by Mussel & Experiment:

Max_CR_FR$Group= factor(paste(Max_CR_FR$Mussel, Max_CR_FR$Experiment))

Selecting on treatment and de-selecting CR_Art with NA:

Art=subset(Max_CR_FR, Treatment=="Artemia" & !$CR_Art))

Everything works fine until here at least.

Calculating the mean of maximum values of CR_Art for each group:

Exp_max=tapply(Data$CR_Art, Data$Group, max, na.rm=TRUE)


for(i in 1:1000) boots[[i]]=Art[,replace=TRUE) ,]
means= lapply( boots, F)
meanstab =,means)

Confidence interval:

R • 954 views
ADD COMMENTlink modified 2.4 years ago by Biostar ♦♦ 20 • written 2.5 years ago by jeff.roemer0

Show head of your original csv data.

ADD REPLYlink modified 2.5 years ago • written 2.5 years ago by PoGibas4.8k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 645 users visited in the last hour