moodymudskipper / myverse

Easily Load a Set of Packages
Other
26 stars 0 forks source link

myverse

Overview

Users often use their .Rprofile to attach the packages they often use but this approach is not ideal as it lacks flexibility and can get in the way of reproducibility.

{myverse} is a fork of the {tidyverse} package that provides a way to attach a predefined list of chosen packages.

You may edit your .Rprofile to set the myverse.pkgs option, and then myverse::myverse_attach() will attach your chosen packages, explicitly by default, just like library(tidyverse) does.

Note: Mike Kearney wrote the package {pkgverse} which has some overlapping functionalities. See comparison at the bottom.

Installation

devtools::install_github("moodymudskipper/myverse")

Usage

# In RProfile (Recommended)
options(
  myverse.pkgs  = c("data.table", "zoo", "matrixStats")
)
# Then at the top of your main script
myverse::myverse_attach()
#> -- Attaching packages ------------------------------------ myverse 0.0.0.9000 --
#> v data.table  1.13.0     v matrixStats 0.57.0
#> v zoo         1.8.8
#> Warning: package 'matrixStats' was built under R version 4.0.3
# In RProfile (Recommended)
options(
  myverse.pkgs  = list(
    c("data.table", "zoo", "matrixStats"),
    muddyverse  = c("flow", "boomer", "typed", "doubt", "unglue", "dotdot", "inops")
  )
)

# attach only "muddyverse" packages
myverse::myverse_attach("muddyverse")
#> -- Attaching packages ------------------------------------ myverse 0.0.0.9000 --
#> v flow   0.0.2          v unglue 0.1.0     
#> v boomer 0.1.0.9000     v dotdot 0.1.0     
#> v typed  0.0.1          v inops  0.0.1     
#> v doubt  0.1.0
#> Warning: package 'typed' was built under R version 4.0.4

Comparison with {tidyverse}

Comparison with {pkgverse}

{pkgverse} helps you build metapackages, it is similar in many ways but there are a few differences to consider to make your choice :