0

Something unusual is happening to me with a code that I have written in R. I have not changed anything in the code but today when I ran it, when writing the file it begins to write it well until a point (random), where R changes the format of a column of a data.table of character to numeric.

I have run it several times and R always change the format of the column, but in different points of the file.

function with i wrote is

write.table(table,gzfile(paste("~/NameFile.csv.gz",sep = "")), row.names = F, sep = "|;|", quote = F, dec = ",")

what can i do?

phalteman
  • 3,442
  • 1
  • 29
  • 46
Douglas89
  • 73
  • 1
  • 2
  • 6
  • 2
    When asking for help, you should include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. What you are describing seems very unlikely so without a reproducible example it will be very difficult to help. Are you sure the data is correct in the data.table?? – MrFlick Jun 14 '18 at 21:28
  • thanks for the suggest. Yes, im sure because i have the same code for two process more and only here R write wrong. Example: the file begin write the column like this **634748323847383** but in some point change the format for **6.347483e+14** – Douglas89 Jun 14 '18 at 21:56
  • 2
    This seems to be related to (or a duplicate of) [Exactly storing large integers](https://stackoverflow.com/questions/32368555/exactly-storing-large-integers) and [Preserving large numbers](https://stackoverflow.com/questions/10711695/preserving-large-numbers) – Maurits Evers Jun 15 '18 at 01:23

0 Answers0