Join GitHub today
Add session_info function #526
This overrides the
It could also be invoked without loading devtools, with
@hadley what do you think about this approach, of overriding the print method?
I just realized that one drawback of putting this function in devtools is that simply loading devtools also results in loading a lot of other packages, making it harder to get a clear view of packages loaded when diagnosing some other issue. For example, with a new R session:
Maybe something like this:
loaded_pkg <- grep("^package:", search(), value = TRUE) loaded_pkg <- sub("^package:", "", packages) attached_pkg <- setdiff(loadedNamespaces(), loaded_pkg) loaded <- rep(c(TRUE, FALSE), c(length(loaded_pkg), length(attached_pkg))) pkgs <- data.frame( package = c(loaded_pkg, attached_pkg), loaded = ifelse(loaded, "*", ""), stringsAsFactors = FALSE ) pkgs$version <- vapply(pkgs$package, function(x) as.character(packageVersion(x)), character(1) ) pkgs <- pkgs[order(pkgs$package), , drop = FALSE] rownames(pkgs) <- NULL