0


I have a large data set that contains numbers with 13+ decimal places. When I imported the data using read.csv, only 9 decimal places were preserved. Is there a way to retain more decimal places? The tasks I need to perform is extremely sensitive to the data so the loss of extra decimal places made a big difference in my final results.

I also tried the following. It does preserve all the decimal places but it turned my data from numeric to characters.

read.csv("data.csv", header = TRUE, sep = ",", quote = "\"", dec = ".", numerals = "no.loss", fill = TRUE, comment.char = "")
Katherine
  • 111
  • 4
  • 3
    R should be preserving all of the decimal places. However, it may only **display** some of those places. Try specifying, for example, `print(x, digits = 13)`. See also: https://stackoverflow.com/a/29880278/4300478 – George Wood Jun 30 '17 at 20:53
  • As others have commented, it's likely a print issue. See also https://stackoverflow.com/questions/2287616/controlling-number-of-decimal-digits-in-print-output-in-r – Eric Watt Jun 30 '17 at 20:54
  • Thanks!!!!!!!!!!!! – Katherine Jul 03 '17 at 14:10

0 Answers0