Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在R中标准化数据-我不断得到一个错误_R - Fatal编程技术网

在R中标准化数据-我不断得到一个错误

在R中标准化数据-我不断得到一个错误,r,R,当我试图在R中标准化我的数据时,我不断得到一个错误。 我正在使用以下代码: normalize<-function(x){ return((x-min(x))/(max(x)-min(x))) } breastcancer<-as.data.frame(lapply(breastcancer[,c(1,2,3,4,5,,6,7,8,9,10,11)],normalize) 您选择的breastcancer中至少有一列是因子。运行sapply(乳腺癌[,c(1,2,3,4,5,6,

当我试图在R中标准化我的数据时,我不断得到一个错误。 我正在使用以下代码:

normalize<-function(x){
return((x-min(x))/(max(x)-min(x)))
}

breastcancer<-as.data.frame(lapply(breastcancer[,c(1,2,3,4,5,,6,7,8,9,10,11)],normalize)

您选择的
breastcancer
中至少有一列是因子。运行
sapply(乳腺癌[,c(1,2,3,4,5,6,7,8,9,10,11)],is.factor)
查找它们。您可以使用冒号创建序列
1:11
Error in Summary.factor(c(7L, 2L, 1L, 2L, 2L, 3L, 2L, 3L, 3L, 10L, 10L,  : 
‘min’ not meaningful for factors