I can control the decimals in the output of skimr in this way:
library(skimr)
options(pillar.sigfig = 2)
skim(faithful)
but I need to be able to output the results to a csv file. Doing this, the decimals are not affected. How can I modify the decimal output of tibbles for export to a csv?
options(pillar.sigfig = 2)
skim(faithful)%>%
write.csv("~/test.csv")
skimr::skim()uses the pillar package to print the underlyingskim_dfobject in the console. If you write theskim_dfto a csv file, printing options are not considered.You can treat the
skim_dflike atibbleordata.frame. The code below shortens the decimals to 2 for all numeric columns in theskim_dfobject.