R - Issues with double precision while writing to an excel file -


i have multiple columns in data frame called 'export', of numeric double precision.

class(export) [1] "grouped_df" "tbl_df"     "tbl"        "data.frame" 

when write down table using following code, excel file has values such 13.0000000000001, 11, 3.9968e-14

write.xlsx(as.data.frame(export), file="test.xlsx", sheetname="test", row.names=false) 

i'm trying columns show pure integer value , columns show 1 decimal.

i did try define of columns integer.

export$col1<-0l 

but, doesn't seem work. assume it's because process column later on using group_by , summarize functions of dplyr package seems turning these columns double again.

my question how 1 column write integer , other columns number 1 decimal? thank you!


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -