I’m having some trouble to use fwrite
when I use a different decimal place. If I have a dataset like this
n = 100
dd = data.table(row_id = 1:n, person=rep(1:20,5), val = runif(n, 10, 50), val2 = runif(n, 20, 40))
dd[person == 1, val:= NA]
fwrite(dd, "dd.csv", bom = TRUE, dec = ",", sep = ";")
The output in val
column, where exists some empty values, is all messed because of the decimal separator, if I replace the missing values with 0 it is all fine. Is there a way to fix it without need to replace empty by 0?