readr changes column type in write_csv; initial data cannot be recovered
I’m working with a dataset that uses long strings of numerics as identifiers. I always make this id
column into class character
because the numerics do not actually represent numbers. I saved and then loaded a dataset using write_csv
and read_csv
and noted that those functions seem to be actually changing the values in the dataframe, which is really troubling. Here’s a reprex:
readr changes column type in write_csv; initial column cannot be recovered
I’m working with a dataset that uses long strings of numerics as identifiers. I always make this id
column into class character
because the numerics do not actually represent numbers. I saved and then loaded a dataset using write_csv
and read_csv
and noted that those functions seem to be actually changing the values in the dataframe, which is really troubling. Here’s a reprex: