[R] output Shapiro-Wild results to a table

R. Michael Weylandt michael.weylandt at gmail.com
Thu May 3 06:10:55 CEST 2012


I'd loop (possibly but not necessarily with *apply) over F1.norm and
get the results directly before returning. E.g.,

lapply(F1.norm, function(x) c(x$p.value, x$statistic))

Michael

On Wed, May 2, 2012 at 1:45 PM, Mary Ann Middleton <maberg at sfu.ca> wrote:
>
> Hello,
>
> I have applied the Shapiro test to a matrix with 26.925 rows of data using the following
>
> F1.norm<-apply(F1.n.mat,1,shapiro.test)
>
> I would now like to view and export a table of the p and W values from the Shapiro test, but I am not sure how to approach this.
>
> I have tried the following with errors.
>> write.table(x=F1.norm,file="I:/R_Work/F1/Shapiro.csv", sep=",") Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) :
>  cannot coerce class '"htest"' into a data.frame
>
> Any suggestions appreciated.
> Mary Ann
> F1
> F1
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list