View source: R/relabel_proportions.R
rename_redundant | R Documentation |
These function are only to be used cosmetically before kable and will likely return a data frame with duplicate names.
rename_redundant(x, ...) augment_redundant(x, ...)
x |
a data frame |
... |
a series of keys and values to replace columns that match specific patterns. |
rename_redundant fully replaces any column names matching the keys
augment_redundant will take a regular expression and rename columns
via gsub()
.
a data frame.
Zhian N. Kamvar
df <- data.frame( x = letters[1:10], `a n` = 1:10, `a prop` = (1:10) / 10, `a deff` = round(pi, 2), `b n` = 10:1, `b prop` = (10:1) / 10, `b deff` = round(pi * 2, 2), check.names = FALSE ) df print(df <- rename_redundant(df, "%" = "prop", "Design Effect" = "deff")) print(df <- augment_redundant(df, " (n)" = " n$"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.