View source: R/append_sum_line.R
append_sum_line | R Documentation |
Appends a new row with column sums for selected columns. A pretext can be placed on the row.
append_sum_line(data, column, pretext = "Sum", position = "left")
data |
[ |
column |
[ |
pretext |
[ |
position |
[ |
One row is appended to the data frame. The sum is calculated with
na.rm = TRUE
.
If a tibble, it is transformed to a data frame to avoid errors if the pretext is to be placed in a numeric variable.
data.frame
with an appended row with sums.
Petter Hopp Petter.Hopp@vetinst.no
## Not run:
# Append row with sum
gris_blodprover_slakteri <- append_sum_line(data = gris_blodprover_slakteri,
column = c("ant_prover"),
pretext = "Sum",
position = "first")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.