knitr::opts_chunk$set(echo = TRUE) library(sysrevdata) library(tictoc)
Hoping to make this function a bit faster.
long_to_wide_original <- function(data, columns, name_sep = '_', value_sep = ';'){ for (i in columns){ data <- data %>% tidyr::pivot_wider(names_from = i, values_from = i, values_fn = list, names_prefix = paste(i, name_sep, sep = ''), values_fill = list(val = 'NA')) %>% dplyr::rename_with(snakecase::to_snake_case) %>% replace_string(replace = 'NULL', with = '') } return(data) }
Check the time.
tic() long_to_wide_original(bufferstrips, columns = names(bufferstrips)[65:84]) toc()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.