rdataframeread.table

read.delim2 and read.table gives two different results?


I have a tab-delimited data: When I use .table some data are missing from the table

df1 = read.table('data_groups.txt', sep='\t', header=T)
dim(df1)

gives me :

318 112

where as:

df2 = read.delim2('data_groups.txt', sep='\t', header=T)
dim(df2)

gives me :

507 112

Solution

  • add quote='' wll solve your issue

    read.table('data_groups.txt', sep='\t', header=T, quote='')