2

I wanted to use the readr package since I will work on some bigger files in the future. My problem is, that there is a column called Intensity which has some very big values (e.g. 5493500000). My problem is, the first time this big value appears is in line 2200 and readr already defined the column as integer instead of numeric and produces a buffer overflow.

Is there a way to only provide a single column type to the read_tsv function, since I don't want to provide all (about) 40 columns the correct type.

Any help os appreciated.

drmariod
  • 11,106
  • 16
  • 64
  • 110

1 Answers1

3

You need the argument col_types = cols(Intensity = col_double()), as per the manual, this will prevent imputation of the column type based on the first 1000 rows. If you only want a subset of the columns use cols_only.

shayaa
  • 2,787
  • 13
  • 19
  • I didn't got the syntax correctly and was wondering if I now need to provide for each column the correct data type. Didn't got I can also overwrite a single type! Tanks thats solves my question. – drmariod Aug 11 '16 at 11:19