Dear useR again,
How can I read a dataset if lines in dataset did not have same
elements (have different lengths), For example:
12, 4, 16, 1, 1, 3, 1, 1, 15, 5, 1, 1, 14, 1, 1
22, 13, 5, 1, 1, 3, 1, 1, 15, 5, 1, 1, 14, 1, 1
34, 5, 11, 1, 1, 6, 1, 1, 5, 14,
If the file is formatted as you've shown, you should be able to read it with
read.fwf().
Andy
From: Xiyan Lon
Dear useR again,
How can I read a dataset if lines in dataset did not have same
elements (have different lengths), For example:
12, 4, 16, 1, 1, 3, 1, 1, 15, 5, 1,
Xiyan Lon wrote:
Dear useR again,
How can I read a dataset if lines in dataset did not have same
elements (have different lengths), For example:
12, 4, 16, 1, 1, 3, 1, 1, 15, 5, 1, 1, 14, 1, 1
22, 13, 5, 1, 1, 3, 1, 1, 15, 5, 1, 1, 14, 1, 1
34, 5, 11, 1, 1, 6,
To: R-help@stat.math.ethz.ch
Subject: [R] Read a dataset with different lengths
Dear useR again,
How can I read a dataset if lines in dataset did not have same
elements (have different lengths), For example:
12, 4, 16, 1, 1, 3, 1, 1, 15, 5, 1, 1, 14, 1, 1
22, 13, 5
Xiyan Lon xiyanlon at gmail.com writes:
:
: Dear useR again,
: How can I read a dataset if lines in dataset did not have same
: elements (have different lengths), For example:
:
: 12, 4, 16, 1, 1, 3, 1, 1, 15, 5, 1, 1, 14, 1, 1
: 22, 13, 5, 1, 1, 3, 1, 1, 15, 5, 1,
Thank you for your quick respons, helps, advise, links, etc.
I have solved my problems now.
Best wishes,
Xiyan Lon
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!