Displaying 1 result from an estimated 1 matches for "num_samp".
Did you mean:
num_comp
2011 Jun 09
2
Calculating a mean based on a factor range
....csv("http://dl.dropbox.com/u/1574243/example_data.csv",
header=TRUE, sep=",")
>
## Calculating an average value from all the readings for each depth reading
> eg.avg <- ddply(eg, c("site", "depth"), function(df)
return(c(temp=mean(df$temperature),
+
num_samp=length(df$temperature)
+ )))
>
## An example of my problem
> eg.avg[eg.avg$num_samp>10 & eg.avg=="Station 3",]
site depth temp num_samp
154 Station 3 1.09000 4.073667 30
159 Station 3 2.49744 3.9...