Skip to contents

Getting started

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.

First, let’s load the required packages.

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
#> 
#> pkgdepR object
#> ------------------------------
#> Packages:    pkgdepR
#> Total nodes: 16
#> Total links: 17
#>   -Between packages: 0
#>   -Within packages:  17
#>     --Between functions: 16
#>     --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
#> 
#> pkgdepR object
#> ------------------------------
#> Packages:    pkgdepR, magrittr
#> Total nodes: 64
#> Total links: 30
#>   -Between packages: 6
#>   -Within packages:  24
#>     --Between functions: 23
#>     --Self-referential:  1
plot(v, height = "700px", main = list(text = NULL), option = "E")







It’s as simple as that!


Back to top