在R中读取文件时没有行名称

在R中读取文件时没有行名称,r,csv,dataframe,rowname,R,Csv,Dataframe,Rowname,我有一个不包含行名的“.txt”文件,但当我使用read.table和row.names=NULL时,它仍然将前两行作为行名 test <- read.table('C:\\somefolder\\myfile.txt', header = FALSE, row.names = NULL) head(test) # V1 V2 V3 #1 1002345017,1598773715,56 ,23 ,29 #2 2000310429,

我有一个不包含行名的“.txt”文件,但当我使用
read.table
row.names=NULL
时,它仍然将前两行作为行名

test <- read.table('C:\\somefolder\\myfile.txt', header = FALSE, row.names = NULL)
head(test)

#                         V1  V2  V3
#1  1002345017,1598773715,56 ,23 ,29
#2  2000310429,1134645573,68 ,12 ,36
#3  3003044126,1403951625,147 ,53 ,28
#4  4045601426,1003975400,38 ,18  ,0
#5  4500450126,1016051119,30 ,15  ,0
#6  6049000126,1013902600,29 ,19  ,2

test您缺少
sep
参数:

res <- read.table(text = "1002345017,1598773715,56 ,23 ,29
2000310429,1134645573,68 ,12 ,36
3003044126,1403951625,147 ,53 ,28
4045601426,1003975400,38 ,18  ,0
4500450126,1016051119,30 ,15  ,0
6049000126,1013902600,29 ,19  ,2", header = FALSE, row.names = NULL, sep= ",")

res您指的是列名吗?您似乎混淆了行和列。。。