[R] loop? apply? I want to repeat a task through 208 itterations.

From: stephen sefick <ssefick_at_gmail.com>
Date: Fri, 04 Apr 2008 11:44:45 -0400

structure(list(RM215alk = c(15, 13, 12, 14, NA, 13, 16, 13, 16, #subset of data
13, 17, 13, 19, 13, 14, 14, 15, 15, 14, 16, 14, 15, 13, 14),

    NSCl = c(NA, NA, 2.9, NA, NA, NA, NA, NA, NA, NA, NA, NA,     NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA)), .Names = c("RM215alk", "NSCl"), class = "data.frame", row.names = c(NA, -24L))

apply(if n>=3(x.f, 2, shapiro.test)else(NULL)) #crappy code showing my lack of knowledge on the subject

I would like to apply this to a 208 column data matrix, and this is the first time I have tried a repetitive task in R- so please bear with me. the shapiro.test requires 3 to 5000 observations and there are some columns that don't have three observation making it unnecessary to preform a test for normality. How do I do this? thanks


Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods. We are mammals, and have not exhausted the
annoying little problems of being mammals.

	-K. Mullis

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 04 Apr 2008 - 15:48:43 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 Apr 2008 - 22:30:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive