string_as_factor <- function(df) {
f_a_s <- function(X) {
if (class(X) %in% c("character")) {
X <- as.factor(X)
}
X
}
purrr::map_df(df, ~f_a_s(.x))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.