Unusual Separators 'space + tab'
I have a table of info from the web with unusual separators. Between columns, it has '1-space and '1-tab'.开发者_运维知识库 When I used the std. 'read.table' with sep=" \t" R kicked it back saying it could only take one byte for a separation. Can I use 'read.table' or something else or should I just run gsub or grep, instead?
Try adding this parameter to your read.table call keeping sep='\t'
:
strip.white=TRUE
Setting this flag to TRUE
will strip leading and trailing white space (unless quoted) that surrounds each entry in a column.
精彩评论