Hi guys,
While trying to load a dataset i get the error below. Where might I be going wrong??
data=read.table('ODI_2002-2011.csv', header = T, sep = ',')
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
line 29 did not have 35 elements
You might likely have missing or blanks for some and that is causing trouble for the file. Specifically look at line 29 of your file. Happy to check for you directly if you can share data.
For you to get read.table to work you will need fill = TRUE. The problem however is that it will still struggle to parse the file correctly as it ends up with 242197 observations x 34 variables. When we look at the file we are expected to see 649925 observations x 34 which read_csv and read_delim achieves. I would rather use either instead of read.table here in this instance.