prettify_strings | R Documentation |
The function searches for x
values, that occur in current
and replaces them with entries in new
. Useful for quick
renaming/translation of survey column names and by using internal object
.trans_df
prettify_strings( x, current = .trans_df$english, new = .trans_df$english_pretty ) prettify_de(x) prettify_en(x)
x |
A character vector (or factor) that should be renamed. |
current |
A vector of characters (possibly subset of |
new |
A vector of characters that will replace entries in |
library(coalitions) library(dplyr) # look at sample German federal election polls surveys <- surveys_sample %>% tidyr::unnest("surveys") %>% group_by(pollster) %>% slice(1) # prettify the polling agency names prettify_strings(surveys$pollster) prettify_en(surveys$pollster) prettify_de(surveys$pollster)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.