-1

I have data containing latitude and longitude coordinates. In R it looks correct, but when I write it as .csv it changes the format.

from: 52.0286 and 5.10374

to: 520.286 and 510.374

In other words, it changes the position of the dot. How can I avoid this from happening? Thank you for your reply

G Data
  • 1
  • 1
  • what happens when you just try to save these columns on their own? What is the code you use now to save to csv? – Jonny Phelps Nov 01 '18 at 16:45
  • Without any sample data or the code you used, it is impossible to reproduce your problem or provide a meaningful answer. Please see this https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example?rq=1 as a good reference on how to ask a question. – Dave2e Nov 01 '18 at 17:06

1 Answers1

0

It usually happens. One temporal solution is to write data into string type.

A reproducible example is here.

library(tidyverse)
mtcars %>% 
    mutate_all(as.character) %>% 
    write_excel_csv('tmp.csv')

Created on 2018-11-02 by the reprex package (v0.2.0).

Jiaxiang
  • 865
  • 12
  • 23