Friday 15 February 2013

r - sep option in read table data input -



r - sep option in read table data input -

i reading info via read.table function in r. how can deal varying field separations? i.e., 1 or 2 whitespaces between columns of table.

number of white spaces not matter. see illustration below:

ddf = read.table(text=" b 1 2 3 4 ", header=t) ddf b 1 1 2 2 3 4 ddf2 = read.table(text=" b 10 20 30 40 50 60 ", header=t) ddf2 b 1 10 20 2 30 40 3 50 60

r

No comments:

Post a Comment