df_replace | R Documentation |
function that replaces (parts of) strings in a data.frame according to a provided table of replacements
df_replace(df, str_replacements = replacementStrings())
df |
data.frame that needs to have strings replaced. Each cell is processed with str_replace_all from the stringr package for all elements of the str_replacements data.frame |
str_replacements |
data.frame defining the replacements, see replacementStrings for more information |
the data.frame with (parts of) strings replaced if present
this function can be called just before passing a data.frame over to eg kableExtra::kbl(). When used in HTML markdown this function sometimes generates unintended behavior, eg converting (part of) strings to email addresses when they contain an @ sign. This functions can replace possible problematic parts with something else. This can be eg latex. For example: replace '@' with '$@$' will solve the email address 'problem'
for obvious reasons only character vector columns are processed
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.