calc | R Documentation |
Create new columns using a list of column names (labels) and
formulas. labels
and formulas
should both be character
vectors of the same length
calc(data, labels, formulas, prefix = "", quiet = TRUE)
data |
The data frame you're manipulating. The |
labels |
A character vector used as the names for the newly created columns. |
formulas |
A character vector of formulas (e.g. |
prefix |
A prefix to append to the beginning of all of the column names
in |
quiet |
Logical, if TRUE, print helpful messages for debugging |
A data frame with the newly calculated columns.
calc(dplyr::tibble(x = c(1,2,3), y = c(2,2,2)), labels = c("x_times_y"),formulas = c("x * y"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.