本来之前没问题,今天更新了Rstudioh以及R,就各种报错了。
cntry1 <- read.csv("cntry1.csv")
报错是:
Error in type.convert.default(data[[i]], as.is = as.is[i], dec = dec, : invalid multibyte string at '<b1><a3><bc><d3>'
然后参照网上教程,试过cntry1 <- read.csv("cntry1.csv", header=T, stringsAsFactors = FALSE, fileEncoding = "UTF-8") ,cntry1 <- read.csv("cntry1.csv", sep=',', fileEncoding = "UTF-8")等,然后报错变成了:
1: In read.table(file = file, header = header, sep = sep, quote = quote, : invalid input found on input connection 'cntry1.csv' 2: In read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeader on 'cntry1.csv'
运行环境是uft-8没错,因为这样看了: