Title: | Visualise and Explore the Deep Dependencies of R Packages |
---|---|
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 <http://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. |
Authors: | Dominik Rafacz [aut, cre] , Hubert Baniecki [aut], Szymon Maksymiuk [aut], Laura Bakala [aut], Dirk Eddelbuettel [ctb] |
Maintainer: | Dominik Rafacz <[email protected]> |
License: | GPL-3 |
Version: | 0.4.2 |
Built: | 2024-11-17 05:41:53 UTC |
Source: | https://github.com/dominikrafacz/deepdep |
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
.
deepdep( package, depth = 1, downloads = FALSE, bioc = FALSE, local = FALSE, dependency_type = "strong" )
deepdep( package, depth = 1, downloads = FALSE, bioc = FALSE, local = FALSE, dependency_type = "strong" )
package |
A |
depth |
An |
downloads |
A |
bioc |
A |
local |
A |
dependency_type |
A |
An object of deepdep
class.
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)
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)
This function runs shiny app that helps to produce nice deepdep plot.
deepdep_shiny()
deepdep_shiny()
Get names of packages that you have locally installed or that are available to be installed.
get_available_packages(bioc = FALSE, local = FALSE, reset_cache = FALSE)
get_available_packages(bioc = FALSE, local = FALSE, reset_cache = FALSE)
bioc |
A |
local |
A |
reset_cache |
A |
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.
A character
vector.
library(deepdep) av <- get_available_packages() head(av)
library(deepdep) av <- get_available_packages() head(av)
This function uses get_description
and get_downloads
to acquire the dependencies of the package (with their downloads).
get_dependencies( package, downloads = TRUE, bioc = FALSE, local = FALSE, dependency_type = "strong" )
get_dependencies( package, downloads = TRUE, bioc = FALSE, local = FALSE, dependency_type = "strong" )
package |
A |
downloads |
A |
bioc |
A |
local |
A |
dependency_type |
A |
An object of package_dependencies
class.
library(deepdep) dependencies <- get_dependencies("htmltools", downloads = FALSE) dependencies dependencies_local <- get_dependencies("deepdep", downloads = FALSE, local = TRUE) dependencies_local
library(deepdep) dependencies <- get_dependencies("htmltools", downloads = FALSE) dependencies dependencies_local <- get_dependencies("deepdep", downloads = FALSE, local = TRUE) dependencies_local
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.
get_description(package, bioc = FALSE, local = FALSE, reset_cache = FALSE)
get_description(package, bioc = FALSE, local = FALSE, reset_cache = FALSE)
package |
A |
bioc |
A |
local |
A |
reset_cache |
A |
An object of package_description
class.
library(deepdep) description <- get_description("ggplot2") description description_local <- get_description("deepdep", local = TRUE) description_local
library(deepdep) description <- get_description("ggplot2") description description_local <- get_description("deepdep", local = TRUE) description_local
This function uses API of CRAN Logs to scrap the download logs of the package.
get_downloads(package)
get_downloads(package)
package |
A |
An object of package_downloads
class.
library(deepdep) downloads <- get_downloads("ggplot2") downloads
library(deepdep) downloads <- get_downloads("ggplot2") downloads
deepdep
objectVisualize dependency data from a deepdep
object using
ggplot2
and ggraph
packages. Several tree-like layouts are available.
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, ... )
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, ... )
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 |
A ggplot2, gg, ggraph, deepdep_plot
class object.
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)
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)
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
.
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(), ...)
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(), ...)
x |
A |
... |
Ignored. |
from |
A |
to |
A |
A ggplot2
class object.
library(deepdep) plot_downloads("htmltools") dd <- deepdep("ggplot2") plot_downloads(dd)
library(deepdep) plot_downloads("htmltools") dd <- deepdep("ggplot2") plot_downloads(dd)
available_packages
classPrint function for an object of available_packages
class
## S3 method for class 'available_packages' print(x, ...)
## S3 method for class 'available_packages' print(x, ...)
x |
An object of |
... |
other |
library(deepdep) av <- get_available_packages() head(av)
library(deepdep) av <- get_available_packages() head(av)
deepdep
classPrint function for an object of deepdep
class
## S3 method for class 'deepdep' print(x, ...)
## S3 method for class 'deepdep' print(x, ...)
x |
An object of |
... |
other |
library(deepdep) dd <- deepdep("stringr") dd
library(deepdep) dd <- deepdep("stringr") dd
package_dependencies
classPrint function for an object of package_dependencies
class
## S3 method for class 'package_dependencies' print(x, ...)
## S3 method for class 'package_dependencies' print(x, ...)
x |
An object of |
... |
other |
library(deepdep) get_dependencies("htmltools", downloads = TRUE)
library(deepdep) get_dependencies("htmltools", downloads = TRUE)
package_description
classPrint function for an object of package_description
class
## S3 method for class 'package_description' print(x, ...)
## S3 method for class 'package_description' print(x, ...)
x |
An object of |
... |
other |
library(deepdep) description <- get_description("ggplot2") description
library(deepdep) description <- get_description("ggplot2") description
package_downloads
classPrint function for an object of package_downloads
class
## S3 method for class 'package_downloads' print(x, ...)
## S3 method for class 'package_downloads' print(x, ...)
x |
An object of |
... |
other |
library(deepdep) desc <- get_downloads("stringr") desc
library(deepdep) desc <- get_downloads("stringr") desc