[R] Loop struggle

2012-03-09 Thread titta majasalmi
Hi, I cannot get rid of this error message: "Warning messages: 1: In if (data$SP == 1) { : the condition has length > 1 and only the first element will be used 2: In if (data$SP == 1) { : the condition has length > 1 and only the first element will be used 3: In if (data$SP == 1) { : the c

[R] Problems with sample means and standard deviations

2011-02-01 Thread Titta
Hi, I am doing program that takes samples y times from listMV and saves the result to list MVdata. The problem is that I need sample mean or standard deviation for each sample (times y) and for all samples together. How can I do that? Mean() and sd() won´t work. Thanks allready, Titta > lis