Reputation: 989
I have a dataframe with two columns called Restaurant and ice.waste. I would like to save this dataframe to Excel. However in Excel the data changes. What could be the reason for this?
This is what it looks like in R:
And this is what it turns out to be in Excel:
Code I use:
write.table(ice.supsale,"C:/Users/../final.ice.csv",
sep = ",", row.names = FALSE)
Upvotes: 0
Views: 55
Reputation: 2222
As a fellow Dutch person, this issue looks very familiar. It's probably because R's default write options are based on US standards (dot as decimal separator) and Excel is reading based on Dutch standards (comma as decimal separator).
I suggest using the command write.csv2()
which uses the correct default settings for your locale.
Upvotes: 2