Ответ 1
Roxygen2 > 3.0.0 значительно быстрее и больше не нуждается в кешировании.
В моей локальной версии roxygen у меня есть:
library(memoize)
cached.parse.ref <- memoize(parse.ref)
cached.parse.srcfile <- memoize(parse.srcfile)
parse.file <- function(file) {
srcfile <- srcfile(file)
res <- try(cached.parse.srcfile(srcfile), silent = TRUE)
if (inherits(res, "try-error")) {
stop("Can't pass", file, "\n", res, call. = FALSE)
}
res
}
parse.srcfile <- function(srcfile) {
srcrefs <- attributes(parse(srcfile$filename,
srcfile=srcfile))$srcref
if (length(srcrefs) > 0)
parse.refs(zip.list(prerefs(srcfile, srcrefs), srcrefs))
else
nil
}
Я думаю, что это единственные изменения, которые вам нужны, но я не уверен. Он ускоряет роксиген на порядок.