The goal of aoc.elf is to provide helper functions for Advent of Code solutions in R.
You can install aoc.elf with:
remotes::install_github("tanho63/aoc.elf")
Configuration options are set with environment variables AOC_COOKIE and AOC_AUTHOR. You can also use the following helper functions:
aoc_set_cookie(cookie = "{COOKIE}")
aoc_set_author(author = "{AUTHOR}")
You can find the cookie value here in your network tab.
Alternatively, you can set AOC_COOKIE and AOC_AUTHOR environment variables in your project’s .Renviron file (this should be a bit more persistent).
It’s important to have an .Rproj file at the top level of your AOC folder, the functions rely on that structure to build the subfolder for each year.
aoc_init(2)
will create a new RMD template for day 2 of the current year. Can also specify year, path, overwrite, and open.
aoc_get(2)
will download and cache inputs for the specified day/year. The template has a chunk with this pre-filled, so you can just run that chunk inside the notebook! (You can also specify year, path, overwite here.)
Please note that the aoc.elf project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.