| adorn_totals {janitor} | R Documentation |
This function excludes the first column of the input data.frame, assuming it's a descriptive variable not to be summed. Non-numeric columns are converted to character class and have a user-specified fill character inserted in the totals row.
adorn_totals(dat, where = "row", fill = "-", na.rm = TRUE)
dat |
an input data.frame with at least one numeric column. If given a list of data.frames, this function will apply itself to each data.frame in the list (designed for 3-way |
where |
one of "row", "col", or |
fill |
if there are multiple non-numeric columns, what string should fill the bottom row of those columns? |
na.rm |
should missing values (including NaN) be omitted from the calculations? |
Returns a data.frame augmented with a totals row, column, or both. The data.frame is now also of class tabyl and stores information about the attached totals and underlying data in the tabyl attributes.
mtcars %>% tabyl(am, cyl) %>% adorn_totals()