I am using R to process Census data which uses really long numeric GEOIDs to identify the geographies. The issue I am facing is when writing out the processed data using write_csv
(from the readr
package) it is writing these GEOIDs in scientific notation. Is there a way to get around this?
Note: I am able to toggle scientific notation display on R console using by setting the scipen
option to a sufficiently large value. But this setting does not seem to extend into the readr
library.
Here is a toy dataset:
library(dplyr)
library(readr) # which is the package with write_csv
(tbl_df(data.frame(GEOID = seq(from=60150001022000, to=60150001022005, 1))))
Source: local data frame [6 x 1]
GEOID
1 60150001022000
2 60150001022001
3 60150001022002
4 60150001022003
5 60150001022004
6 60150001022005
write_csv((tbl_df(data.frame(GEOID = seq(from=60150001022000, to=60150001022005, 1)))), "test.csv")
This is what I am getting currently. I am looking for a way to get the same numbers as above:
GEOID
6.02E+13
6.02E+13
6.02E+13
6.02E+13
6.02E+13
6.02E+13