RStudio:读取csv文件报错

> tab<- read.csv("data.csv",header = TRUE,stringsAsFactors = F,na.strings = "")
Warning messages:
1: In read.table(file = file, header = header, sep = sep, quote = quote,  :
  line 1 appears to contain embedded nulls
2: In read.table(file = file, header = header, sep = sep, quote = quote,  :
  incomplete final line found by readTableHeader on 'data.csv'

原因:偷懒,直接将Excel文件复制粘贴,再修改这个副本文件后缀为.csv

解决:打开Excel文件另存为.csv格式

RStudio:读取csv文件报错_第1张图片

你可能感兴趣的:(R语言)