r语言输入链接内的输入不对

Python017

r语言输入链接内的输入不对,第1张

程序出现错误不能运转。

city=read.csv("2.csv",header=FALSE,fileEncoding="UTF-8",encoding="UTF-8")警告信息:1: In read.table(file = file, header = header, sep = sep, quote = quote, :输入链结'2.csv'内的输入不对2: In read.table(file = file, header = header, sep = sep, quote = quote, :incomplete final linefound by readTableHeader on '2.csv'。

R怎么知道你的文件是放在桌面而不是别的地方。两个办法:设定工作目录:setwd("d:/")然后把txt放在d盘根目录下,用read.table读取直接把路径带入读入 read.table("d:/exam0203.txt", header=T)其余的就都解决了吧

看不出错误,语句写的应该没有问题。你可以查一下days_to_death和days_to_last_follow_up的数据格式是什么,str(a),我之前遇到过变量是时间格式导致的显示问题,换成integer或者character试试。