Skip to content

Why can't this function be used with the 'by' command?

2 messages · Kaiyin Zhong, R. Michael Weylandt

#
I believe it has to do with passing multiple columns to the
shapiro.test. Note that

by(x[,1:2], x$group, function(x) shapiro.test(x)[[2]])

doesn't work but

by(x[,1:2], x$group, function(x) shapiro.test(x[,1])[[2]])

does.

Michael
On Thu, Nov 3, 2011 at 8:08 AM, Kaiyin Zhong <kindlychung at gmail.com> wrote: