format tables in xlsx frmat

I want to format tables in in xlsx format and save it to xlsx file .
convert third column in percentage value

mtcars
df <- mtcars[,1:5]

I want to format a table like below and save it to xlsx file.

mpg cyl disp hp drat
Mazda RX4 21 6 160% 110 3.9
Mazda RX4 Wag 21 6 160% 110 3.9
Datsun 710 22.8 4 108% 93 3.85
Hornet 4 Drive 21.4 6 258% 110 3.08
Hornet Sportabout 18.7 8 360% 175 3.15
Total 104.9 30 10.46 598 17.88

You can use the function adorn_totals("row") from the {janitor} library to quickly append a totals row at the bottom of the data frame. You can then use the {writexl} library to export the data farme to Excel.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.