I have a data file with 21 rows but the no. of columns in each row are different. The first column is the header and remaining columns have numbers.
So, I import the file using: d <- read.table("data.txt", sep = " ", fill=T)
. But when I looked at the data using view()
, I see that one row with a lot of columns (160,000+) is split into 3 rows. A picture showing this phenomenon is here.
Why is R doing this? And how can I fix it so I get 21 rows? I'd appreciate any help/pointers. I am using R Studio (64 bit) on Windows 7 with 16 GB memory.
Also, I did look around before posting but did not have much luck. The 'reshape' package seemed at first to be of some help but I couldn't really use it to suit my needs. Any tip to fix the issue during import or post-import would be appreciated. Thanks.