I'm getting stuck on an interesting problem where my dataframe contains values of the following type: 1e1, 1e2, 1e3, 1e4... For example:
df <- data.frame(
col1 = rep("1e1", 10)
)
And I need to perform some data transformation, and write the dataframe into a new csv using read_csv() function.
However, if you type a number with an “e” in excel, such as 1e1, it will automatically result in a scientific number: 1.00E+09. I understand that in excel, if you don’t want a scientific number, enter an apostrophe before the number: '1e1. But I'm unable to write a new csv file with values like '1e1, because then it would be interpreted as text in the output csv.
I need my values to remain in their original form as either text or factors, and I wish to still be able to work on this via csv files.
In addition to Yarnabrina's reply, for more details checkout: vignette("readr") and scroll down to the column specification section onwards for lots of information and examples on what the defaults for read_csv are and how to override them.