在R中使用read.arff()函数并导入.arff文件

时间:2018-01-20 14:00:34

标签: r

我正在尝试导入.arff类型的数据集

file_location <- file.path("/Users","supreet","Downloads","Chronic_Kidney_Disease1/")
Chronic_Kidney_Disease <- read.arff(paste(file_location,"chronic_kidney_disease.arff",sep=""))

但它引发了以下错误

  

文件错误(arff_file,“rb”):无法打开连接   另外:警告信息:在文件中(arff_file,“rb”):无法打开   文件   '/Users/supreet/Downloads/Chronic_Kidney_Disease1/chronic_kidney_disease.arff.arff':   没有这样的文件或目录

此外,如果删除.arff扩展名,因为它已经附加:

file_location <- file.path("/Users","supreet","Downloads","Chronic_Kidney_Disease1/")
Chronic_Kidney_Disease <- read.arff(paste(file_location,"chronic_kidney_disease",sep=""))

我收到此错误:

  

错误:XML内容似乎不是XML:   '/Users/supreet/Downloads/Chronic_Kidney_Disease1/chronic_kidney_disease.xml'   另外:警告信息:在矩阵中(unlist(strsplit(arff_data,   “,”,fixed = T)),ncol = num_attrs,:数据长度[10001]不是a   行数的多个或多个[401]   &GT;

0 个答案:

没有答案