remove_last_col <- function(data) {
cols <- last(colnames(data))
select(data, -cols)
}
ohe <- function(data) {
data %>%
tibble::as_tibble() %>%
dplyr::mutate(one = 1L) %>%
dplyr::mutate(rowid = 1:nrow(.)) %>%
tidyr::spread(1, 2, fill = 0L) %>%
dplyr::select(-rowid)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.