split_txt | R Documentation |
Many Advent of Code challenges have a comma-delimited input. This works on either a string or a table (since some challenges are just a set of comma-delimited numbers)
split_txt(s, sep = ",", parse = TRUE)
s |
Either a string, or a table with one row |
parse |
Whether to parse with |
# 2021 Days 6 and 7 were both just a comma-delimited vector of numbers advent_input(6) %>% split_txt() advent_input(7) %>% split_txt() # So was the first line (though not the rest) of Day 4 advent_input(4) %>% slice(1) %>% split_txt()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.