I need to generate a dataframe or data.table which has different number of decimal places per column.
For example:
Scale Status
1.874521 1
Needs to be print in a CSV as:
Scale, Status
1.874521, 1.000
This has to be as a numeric value as I have tried format(DF$status, digits=3)
and as.numeric(format(DF$status, digits=3))
however this converts it to characters which when exported to CSV has double quotes ".
My actual dataframe has lots of columns with different amounts of decimal places required as well as characters which do need to be double quoted so I can't apply a system wide change.