Slightly less clunky handling of stringsAsFactors
This commit is contained in:
@@ -11,10 +11,13 @@
|
||||
#' @import parallel
|
||||
#' @export
|
||||
snapshot_create <- function(installOpts = list(Ncpus = parallel::detectCores())) {
|
||||
old_opt <- options(stringsAsFactors = FALSE)
|
||||
on.exit(options(old_opt))
|
||||
|
||||
lastSnapshot <- snapshot_latest()
|
||||
customSources <- empty_sources()
|
||||
if (!is.null(lastSnapshot) && "custom" %in% names(lastSnapshot$packages)) {
|
||||
customSources <- rbind(customSources, lastSnapshot$packages$custom, stringsAsFactors = FALSE)
|
||||
customSources <- rbind(customSources, lastSnapshot$packages$custom)
|
||||
}
|
||||
packages <- compile_imports(customSources, installOpts)
|
||||
names(packages) <- c("core", "direct", "indirect", "custom", "install_order")
|
||||
|
||||
Reference in New Issue
Block a user