0

I want to apply Anderson-Darling normality test to all columns on a big data frame in R.

To apply the test on one columns, I'm using:

library(nortest)
ad.test(df$col1)

I tried the following to apply it to every single column, but it didn't work:

ad.test(df)  
*Error in [.data.frame(x, complete.cases(x)) :    undefined columns selected*

normality_check = lapply(df,ad.test) 
*Error in if (AA < 0.2) { : missing value where TRUE/FALSE needed*

Any suggestions on how to do this?

ekstroem
  • 5,957
  • 3
  • 22
  • 48
Bayram Sarilmaz
  • 103
  • 1
  • 3
  • 13

0 Answers0