Thanks for the feedback Patrizio - but your function is performing the shapiro.test on columns instead of rows...
I tried: nt<-data.frame(#a dataframe with 6 columns and 9 rows) nr <- nrow(nt) test <- apply(nt, nt[1:nr,], shapiro.test) Error in ds[-MARGIN] : invalid subscript type 'list' fred<-data.frame(sapply(test,function(x)c(x$statistic, x$p.value))) But picked up the error above. Do I still require a loop to apply this over rows? -- View this message in context: http://r.789695.n4.nabble.com/Finding-non-normal-distributions-per-row-of-data-frame-tp3259439p3260412.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.