I have trouble finding ways to import files efficiently that are formatted European style (a ,
comma for decimals and .
dot for thousands 12.300,35
) from google sheets via the library(googlesheets)
package. R will automatically read the commas as delimiters and not as decimal signs.
When downloading the sheet (via R), it automatically chooses a comma separator. Can I customize that?
Here's my data via a shared google sheets link.
My code:
library(googlesheets)
# Authenticate with your google sheets
sheets <- gs_ls()
# Import
spreadsheet <- gs_title("sample_data")
# Read dataset
sample <- gs_read(spreadsheet, ws = 1)
With the wrong results:
jaren hbo_procent wo_procent
<int> <dbl> <dbl>
1 2006 66.0 9.00
2 2007 67.0 97.0
3 2008 7.00 104
4 2009 73.0 112
5 2010 75.0 119
6 2011 77.0 128
7 2012 78.0 137
8 2013 76.0 142
9 2014 74.0 148
10 2015 75.0 163
11 2016 75.0 181
12 2017 78.0 195