forked from RConsortium/submissions-pilot1
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#List out packages used for R analysis in the adrg.pdf | ||
|
||
library(tidyr) | ||
library(data.table) | ||
|
||
pkgloaded <- sessionInfo()$loadedOnly #get intial list of packages that were loaded | ||
pkgother <- sessionInfo()$otherPkgs #get initla list of packages that were also listed in the Session but may not have been used | ||
|
||
loaded <- data.frame(rbindlist(pkgloaded, idcol = TRUE, fill=T)) %>% | ||
select(Package, Title, Version, Description) %>% | ||
mutate(loaded='Y') | ||
other <- data.frame(rbindlist(pkgother, idcol = TRUE, fill=T)) %>% | ||
select(Package, Title, Version, Description) %>% | ||
mutate(loaded='N') | ||
|
||
pkgdesc <- bind_rows(loaded, other) # stacks all package data frames. | ||
# NOTE column 'loaded', from this data frame can be used to subset out packages not used and may not be needed for the adrg.pdf | ||
|
||
# update path to save CSV in your local area. | ||
write.csv(pkgdesc, "/cloud/project/submission/pkgs4adrg.csv", row.names=FALSE) |