开发者

Unusual Separators 'space + tab'

开发者 https://www.devze.com 2023-03-29 02:14 出处:网络
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 sayi

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消