我正在尝试将数据导入R. 当我提交
Dataset <- read.table("Data.txt",
header = TRUE, sep = "\t", na.strings = "NA", dec = ".", strip.white = TRUE)
它有效,但当我添加row.names = 1
并提交
Dataset <- read.table("Data.txt",
header = TRUE, sep = "\t", na.strings = "NA", dec = ".", row.names = 1, strip.white = TRUE)
我得到ERREUR:<text>
答案 0 :(得分:2)
如果您的第一个实例有效,也许最简单的方法就是:
`Dataset <- read.table("Data.txt", header = TRUE, sep = "\t",
na.strings = "NA", dec = ".", strip.white = TRUE)
rownames(Dataset) <- Dataset[, 1]
Dataset <- Dataset[, -1]`
您应该拥有Data.txt
的第一列是Dataset