我有一个非常简单的数组,我想在上面运行 ROC 曲线分析。但首先,当我尝试使用命令将数据强制转换为因子类型时table[1]<-factor(table[1])
,我得到了错误
Error in sort.list(y) : 'x' must be atomic for 'sort.list'
Have you called 'sort' on a list?
下面给出了数据中的几个示例行
GRADE TRUE-GRADE
benign Benign
benign Benign
benign Benign
benign Benign
benign Benign
benign Benign
benign Malignant
benign Malignant
indeterminate Benign
indeterminate Benign
indeterminate Benign
indeterminate Benign
indeterminate Benign
indeterminate Benign
indeterminate Benign
indeterminate Benign
indeterminate Benign
indeterminate Benign
indeterminate Benign
indeterminate Benign
indeterminate Benign
indeterminate Malignant
indeterminate Malignant
indeterminate Malignant
likely benign Benign
likely benign Benign
likely benign Benign
有人可以告诉我我做错了什么吗?str(table) 的结果如下:
data.frame': 127 obs. of 2 variables:
$ GRADE : Factor w/ 5 levels "benign","indeterminate",..: 1 1 1 1 1 1 1 1 1
$ BENIGN.MALIGN: Factor w/ 2 levels "Benign","Malignant": 1 1 1 1 1 1 1 1 1 1 ...