Truncated Fractions while Writing to CSV

Hello Posit Community:

I want to write a data frame that includes columns of GPS coordinates to a CSV sheet; they need to be accurate and so a coordinate could have at least 10 fractions/digits. When I write it, it results in some of the fractions getting truncated and automatically rounded, which, in return, causes locations to be different from the original coordinates' locations.

Are there any methods to prevent that? Are there specific parameters that need to be set-up in the write.csv() function?

If you'll forgive an odd question, are you sure that's what's happening? The documentation says that numbers are written out at full precision. If you open a .csv file in Excel it rounds the numbers in the displayed spreadsheet even though the number is actually stored in full precision.

1 Like

Yes, you're absolutely right! For some reason as I upload that csv file to Spark, they get truncated but when I re-ran this again it did work. Thanks!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.