【发布时间】:2021-05-12 07:31:21
【问题描述】:
我正在尝试编写一个函数来为我的数据框中的多个列运行 shapiro 测试。我尝试使用以下代码,但它一直返回此错误。 我已确保相关列是数字。
fun1<- function(x){
shapiro.test(names(data)[22:31])
}
这是我遇到的错误
Error in shapiro.test(names(TBI)[22:31]) : is.numeric(x) is not TRUE
【问题讨论】:
标签: r function statistics