Skip to contents

Installation

You can install the released version of {pkgdepR} from CRAN with:

install.packages("pkgdepR")

And the development version from GitHub with:

devtools::install_github("edpeyton/pkgdepR")

How to use

Here we’ll show an example of how to use {pkgdepR} using some test packages that are hosted on GitHub.

First, let’s load the required example packages.

library(pkgdepR)
library(magrittr)

The required packages have now been added to the search path.

Single package

Create a pkgdepR object as follows:

v = pkgdepR::deps(pkg = "pkgdepR")

We can see a summary of the object

v # alternatively, summary(v) or print(v)
#> 
#> pkgdepR object
#> ------------------------------
#> Packages:    pkgdepR
#> Total nodes: 15
#> Total links: 18
#>   -Between packages: 0
#>   -Within packages:  18
#>     --Between functions: 17
#>     --Self-referential:  1

To see the network visualization, simply call plot.

plot(v, height = "500px", main = list(text = NULL))







Multiple packages

Visualizing multiple packages works in a similar way.

v = pkgdepR::deps(pkg = c("pkgdepR", "magrittr"))
v # alternatively, summary(v) or print(v)
#> 
#> pkgdepR object
#> ------------------------------
#> Packages:    pkgdepR, magrittr
#> Total nodes: 67
#> Total links: 48
#>   -Between packages: 7
#>   -Within packages:  41
#>     --Between functions: 39
#>     --Self-referential:  2
plot(v, height = "700px", main = list(text = NULL), option = "E")







It’s as simple as that!


Back to top