Title: | Visualise and Explore the Deep Dependencies of R Packages |
Version: | 0.4.3 |
Description: | Provides tools for exploration of R package dependencies. The main deepdep() function allows to acquire deep dependencies of any package and plot them in an elegant way. It also adds some popularity measures for the packages e.g. in the form of download count through the 'cranlogs' package. Uses the CRAN metadata database http://crandb.r-pkg.org and Bioconductor metadata https://bioconductor.org. Other data acquire functions are: get_dependencies(), get_downloads() and get_description(). The deepdep_shiny() function runs shiny application that helps to produce a nice 'deepdep' plot. |
License: | GPL-3 |
Encoding: | UTF-8 |
RoxygenNote: | 7.2.3 |
Depends: | R (≥ 3.2.0) |
Imports: | cranlogs, httr, jsonlite |
Suggests: | BiocManager, covr, devtools, ggplot2, ggraph, graphlayouts, igraph, knitr, miniCRAN, plyr, rmarkdown, scales, shiny, shinycssloaders, spelling, stringi, testthat (≥ 2.1.0), vcr |
VignetteBuilder: | knitr |
URL: | https://dominikrafacz.github.io/deepdep/, https://github.com/DominikRafacz/deepdep |
BugReports: | https://github.com/DominikRafacz/deepdep/issues |
Language: | en-GB |
NeedsCompilation: | no |
Packaged: | 2024-03-12 17:35:00 UTC; Dominik Rafacz |
Author: | Dominik Rafacz |
Maintainer: | Dominik Rafacz <dominikrafacz@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2024-03-12 21:10:07 UTC |
Acquire the dependencies of the package on any depth level
Description
This function is an ultimate wrapper for get_dependencies
. It inherits all of the arguments and
allows to recursively search for the dependencies at the higher level of depth
.
Usage
deepdep(
package,
depth = 1,
downloads = FALSE,
bioc = FALSE,
local = FALSE,
dependency_type = "strong"
)
Arguments
package |
A |
depth |
An |
downloads |
A |
bioc |
A |
local |
A |
dependency_type |
A |
Value
An object of deepdep
class.
See Also
Examples
library(deepdep)
dd_downloads <- deepdep("ggplot2")
head(dd_downloads)
dd_2 <- deepdep("ggplot2", depth = 2, downloads = TRUE)
plot_dependencies(dd_2, "circular")
dd_local <- deepdep("deepdep", local = TRUE)
plot_dependencies(dd_local)
Run Shiny app
Description
This function runs shiny app that helps to produce nice deepdep plot.
Usage
deepdep_shiny()
Get the list of available packages
Description
Get names of packages that you have locally installed or that are available to be installed.
Usage
get_available_packages(bioc = FALSE, local = FALSE, reset_cache = FALSE)
Arguments
bioc |
A |
local |
A |
reset_cache |
A |
Details
Function uses caching - only the first usage scraps information from servers. Those objects are then saved locally in temporary file and further usages loads needed data from the file.
Arguments bioc
and local
cannot be TRUE
simultaneously.
If neither local
nor bioc
are TRUE
, vector contains all packages available
currently on CRAN. If bioc
is TRUE
, vector contains all packages available currently
on CRAN and via Bioconductor. If local
is TRUE
, vactor contains all of the packages
that are currently installed.
Value
A character
vector.
Examples
library(deepdep)
av <- get_available_packages()
head(av)
Acquire the dependencies of the package
Description
This function uses get_description
and get_downloads
to acquire the dependencies of the package (with their downloads).
Usage
get_dependencies(
package,
downloads = TRUE,
bioc = FALSE,
local = FALSE,
dependency_type = "strong"
)
Arguments
package |
A |
downloads |
A |
bioc |
A |
local |
A |
dependency_type |
A |
Value
An object of package_dependencies
class.
See Also
Examples
library(deepdep)
dependencies <- get_dependencies("htmltools", downloads = FALSE)
dependencies
dependencies_local <- get_dependencies("deepdep", downloads = FALSE, local = TRUE)
dependencies_local
Scrap the DESCRIPTION file and CRAN metadata of the package
Description
This function uses api of CRAN Data Base to scrap the DESCRIPTION file and CRAN metadata of the package. It caches the results to speed the computation process.
Usage
get_description(package, bioc = FALSE, local = FALSE, reset_cache = FALSE)
Arguments
package |
A |
bioc |
A |
local |
A |
reset_cache |
A |
Value
An object of package_description
class.
Examples
library(deepdep)
description <- get_description("ggplot2")
description
description_local <- get_description("deepdep", local = TRUE)
description_local
Scrap the download data of the package
Description
This function uses API of CRAN Logs to scrap the download logs of the package.
Usage
get_downloads(package)
Arguments
package |
A |
Value
An object of package_downloads
class.
Examples
library(deepdep)
downloads <- get_downloads("ggplot2")
downloads
Main plot function for a deepdep
object
Description
Visualize dependency data from a deepdep
object using
ggplot2
and ggraph
packages. Several tree-like layouts are available.
Usage
plot_dependencies(
x,
type = "circular",
same_level = FALSE,
reverse = FALSE,
label_percentage = 1,
show_version = FALSE,
show_downloads = FALSE,
show_stamp = TRUE,
declutter = FALSE,
...
)
## Default S3 method:
plot_dependencies(
x,
type = "circular",
same_level = FALSE,
reverse = FALSE,
label_percentage = 1,
show_version = FALSE,
show_downloads = FALSE,
show_stamp = TRUE,
declutter = FALSE,
...
)
## S3 method for class 'character'
plot_dependencies(
x,
type = "circular",
same_level = FALSE,
reverse = FALSE,
label_percentage = 1,
show_version = FALSE,
show_downloads = FALSE,
show_stamp = TRUE,
declutter = FALSE,
...
)
## S3 method for class 'deepdep'
plot_dependencies(
x,
type = "circular",
same_level = FALSE,
reverse = FALSE,
label_percentage = 1,
show_version = FALSE,
show_downloads = FALSE,
show_stamp = TRUE,
declutter = FALSE,
...
)
Arguments
x |
A |
type |
A |
same_level |
A |
reverse |
A |
label_percentage |
A |
show_version |
A |
show_downloads |
A |
show_stamp |
A |
declutter |
A |
... |
Other arguments passed to the |
Value
A ggplot2, gg, ggraph, deepdep_plot
class object.
Examples
library(deepdep)
#:# use local packages
plot_dependencies("deepdep", depth = 2, local = TRUE)
dd <- deepdep("ggplot2")
plot_dependencies(dd, "tree")
dd2 <- deepdep("ggplot2", depth = 2)
plot_dependencies(dd2, "circular")
#:# show grand_total download count
plot_dependencies("shiny", show_downloads = TRUE)
Plot download count of CRAN packages.
Description
This function uses API of
CRAN Logs to scrap the download logs of the packages and
then plots the data. It works on objects of class character
(vector),
deepdep
, package_dependencies
and package_downloads
.
Usage
plot_downloads(x, ...)
## Default S3 method:
plot_downloads(x, ...)
## S3 method for class 'deepdep'
plot_downloads(x, from = Sys.Date() - 365, to = Sys.Date(), ...)
## S3 method for class 'package_dependencies'
plot_downloads(x, from = Sys.Date() - 365, to = Sys.Date(), ...)
## S3 method for class 'package_downloads'
plot_downloads(x, from = Sys.Date() - 365, to = Sys.Date(), ...)
## S3 method for class 'character'
plot_downloads(x, from = Sys.Date() - 365, to = Sys.Date(), ...)
Arguments
x |
A |
... |
Ignored. |
from |
A |
to |
A |
Value
A ggplot2
class object.
Examples
library(deepdep)
plot_downloads("htmltools")
dd <- deepdep("ggplot2")
plot_downloads(dd)
Print function for an object of available_packages
class
Description
Print function for an object of available_packages
class
Usage
## S3 method for class 'available_packages'
print(x, ...)
Arguments
x |
An object of |
... |
other |
Examples
library(deepdep)
av <- get_available_packages()
head(av)
Print function for an object of deepdep
class
Description
Print function for an object of deepdep
class
Usage
## S3 method for class 'deepdep'
print(x, ...)
Arguments
x |
An object of |
... |
other |
Examples
library(deepdep)
dd <- deepdep("stringr")
dd
Print function for an object of package_dependencies
class
Description
Print function for an object of package_dependencies
class
Usage
## S3 method for class 'package_dependencies'
print(x, ...)
Arguments
x |
An object of |
... |
other |
Examples
library(deepdep)
get_dependencies("htmltools", downloads = TRUE)
Print function for an object of package_description
class
Description
Print function for an object of package_description
class
Usage
## S3 method for class 'package_description'
print(x, ...)
Arguments
x |
An object of |
... |
other |
Examples
library(deepdep)
description <- get_description("ggplot2")
description
Print function for an object of package_downloads
class
Description
Print function for an object of package_downloads
class
Usage
## S3 method for class 'package_downloads'
print(x, ...)
Arguments
x |
An object of |
... |
other |
Examples
library(deepdep)
desc <- get_downloads("stringr")
desc