ENV:
R version 3.3.1
MAC OS X 10.9.4
I have data in file like:
V1 | V2 | V3
------ | ------ | ------
1 | 2 | 3
0.5 | 0.3 | 0.2
But when I use read.table to import the data and print it to the screen, it looks like:
V1 | V2 | V3
------ | ------ | ------
1.000000 | 2.000000 | 3.0000
0.500000 | 0.300000 | 0.20000
Values in the first row changes from integer to float.
Expected:
V1 | V2 | V3
------ | ------ | ------
1 | 2 | 3
0.500000 | 0.300000 | 0.20000
There is colClasses
in read.table but there is no rowClasses to specific data type of rows.
Is it possible to specific rows data using read.table? I did not find any solution yet. Thanks. Any references or alternative ways would be appreciated.