vanmooylipidomics / LOBSTAHS

Git repository for the R package "LOBSTAHS" (Lipid and Oxylipin Biomarker Screening Through Adduct Hierarchy Sequences)
Other
8 stars 12 forks source link

Ignore "empty" lines of csv data when reading user-supplied input tables #18

Open jamesrco opened 7 years ago

jamesrco commented 7 years ago

Currently, the implementation of read.table() used in LOBSTAHS will return an error

Error in read.table("/Users/jamesrco/Desktop/LOBSTAHS_componentCompTable.csv",  : 
  duplicate 'row.names' are not allowed

if the user supplies a .csv file with "empty" lines of csv data in it. Depending on how Excel is used to save/write .csv files, these lines will sometimes be retained in the saved file -- even though it appears to the user in Excel that they've been deleted.

When using the row.names = 1 argument in read.table(), these lines appear to have duplicate row names since the first field is the same (a blank value) in all of them.

Perhaps we can write something that detects "blank" lines and automatically deletes them, before passing the file handle off to read.table()?