I have a package that uses a pre-built dataset that may be modified over time by other parts of the package. Specifically, I have files that I add to the inst directory that will be indexed to make a data.frame. The indexing does not take a very long time (about 15-30 seconds), but it is longer than something I'd like to do on every package load.
Is there a way to automate the indexing so that it will occur with roxygen2::roxygenize()? What I'd really love to have happen is that an R function from the package would run any time I run devtools::document(). I think that this is possible by creating a custom roclet, but I don't understand quite how I would do this in practice.