View source: R/table_recipe_utils.R
| init_new_cols | R Documentation |
Initialize new columns of the correct length
init_new_cols(
n,
colnames = names(colclasses),
colclasses = setNames(rep(NA, length(colnames)), colnames)
)
n |
numeric(1). The length (number of rows) to use when initializing. |
colnames |
character. Vector of column names to use. Can be omitted if |
colclasses |
named character. Optional. Names must be identical to |
A data.frame with the new columns and n rows.
init_new_cols(5, c("col1", "col2"))
init_new_cols(5, colclasses = c(col1 = NA, col2 = "integer"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.