Let the following vectors:
x <- c(123456789123456789, 987654321987654321) y <- as.character(x)
I am trying to export y to a csv file for later conversion to XLSX (do not ask, the client requested), for example:
write.csv(y, file = 'y.csv', row.names = F)
If I open y.csv in a pure word processor, I see that he correctly inserted the quotation marks around the elements, but when I open it in Excel, the program insists on converting the column to numbers and displaying the contents in a scientific format. This requires an additional reformatting step column, which can be in real time when you work with a large number of files.
How to format a character vector from 20-digit numbers to R so that Excel does not display them in scientific notation?
source share