{"id":14068935,"url":"https://github.com/ikosmidis/cranly","last_synced_at":"2025-07-30T05:31:00.999Z","repository":{"id":42596793,"uuid":"126724937","full_name":"ikosmidis/cranly","owner":"ikosmidis","description":"Package directives and collaboration networks in CRAN","archived":false,"fork":false,"pushed_at":"2022-08-28T13:41:55.000Z","size":187071,"stargazers_count":49,"open_issues_count":3,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-25T17:21:42.712Z","etag":null,"topics":["cran-r","network-analysis","network-visualization","rstats"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ikosmidis.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-25T18:00:52.000Z","updated_at":"2024-02-06T13:37:55.000Z","dependencies_parsed_at":"2022-09-22T14:41:16.116Z","dependency_job_id":null,"html_url":"https://github.com/ikosmidis/cranly","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikosmidis%2Fcranly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikosmidis%2Fcranly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikosmidis%2Fcranly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ikosmidis%2Fcranly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ikosmidis","download_url":"https://codeload.github.com/ikosmidis/cranly/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228092093,"owners_count":17868131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cran-r","network-analysis","network-visualization","rstats"],"created_at":"2024-08-13T07:06:29.591Z","updated_at":"2025-07-30T05:31:00.985Z","avatar_url":"https://github.com/ikosmidis.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"inst/README_files/README-\",\n  cache.path = \"inst/README_cache/README-\",\n  fig.width = 7,\n  fig.height = 7\n)\n```\n\n[![Travis-CI Build Status](https://travis-ci.org/ikosmidis/cranly.svg?branch=master)](https://travis-ci.org/ikosmidis/cranly)\n[![Coverage Status](https://img.shields.io/codecov/c/github/ikosmidis/cranly/master.svg)](https://codecov.io/github/ikosmidis/cranly?branch=master)\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/cranly)](https://cran.r-project.org/package=cranly)\n[![Licence](https://img.shields.io/badge/licence-GPL--3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)\n\n# cranly\n\n[**cranly**](https://github.com/ikosmidis/cranly) provides core visualizations and summaries for the CRAN package database. It is aimed mainly as an analytics tool for developers to keep track of their CRAN packages and profiles, as well as those of others, which, at least for me, is proving harder and harder with the rapid growth of the [CRAN](https://cran.r-project.org) ecosystem.\n\nThe package provides methods for cleaning up and organizing the information in the CRAN package database, for building package directives networks (depends, imports, suggests, enhances, linking to) and collaboration networks, and for computing summaries and producing interactive visualizations from the resulting networks. Network visualization is through the [**visNetwork**](https://CRAN.R-project.org/package=visNetwork) package. The package also provides functions to coerce the networks to [igraph](https://CRAN.R-project.org/package=igraph) objects for further analyses and modelling.\n\n### Installation\n\nInstall the development version from github:\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"ikosmidis/cranly\")\n```\n\n### Collaboration and package directives networks in CRAN\n\nLoad **cranly** as\n```{r}\nlibrary(\"cranly\")\n```\n\nThe first step in the **cranly** workflow is to try and\n\"clean-up\" the package and author names in the data frame that results\nfrom a call to `tools::CRAN_package_db()`\n```{r cache = TRUE}\np_db \u003c- tools::CRAN_package_db()\npackage_db \u003c- clean_CRAN_db(p_db)\n```\nThe CRAN database we use is from\n```{r}\nattr(package_db, \"timestamp\")\n```\n\n#### Package directives networks\n\nThe package directives network can then be built using\n```{r cache = TRUE}\npackage_network \u003c- build_network(package_db)\n```\n`package_network` can then be interrogated using extractor methods\n(see, `?package_by`). For example, my packages can be extracted as follows\n```{r}\nmy_packages \u003c- package_by(package_network, \"Ioannis Kosmidis\")\nmy_packages\n```\nand their sub-network of directives can be summarized in an interactive visualization, a snapshot of which is below\n```{r my_pkgs, screenshot.opts = list(delay = 2)}\nplot(package_network, package = my_packages, title = TRUE, legend = TRUE)\n```\n\n\nWe can also compute package summaries and plot \"Top-n\" lists according to the various summaries\n```{r pkg_summaries}\npackage_summaries \u003c- summary(package_network)\nplot(package_summaries, according_to = \"n_imported_by\", top = 20)\nplot(package_summaries, according_to = \"page_rank\", top = 20)\n```\n\n#### Collaboration networks\nThe collaboration network can also be built using a similar call\n```{r cache = TRUE}\nauthor_network \u003c- build_network(package_db, perspective = \"author\")\n```\nand the extractor functions work exactly as they did for the package directives network. For example, my collaboration network results can be summarized as an interactive visualization, a snapshot of which is below\n```{r my_aut, screenshot.opts = list(delay = 2)}\nplot(author_network, author = \"Ioannis Kosmidis\")\n```\n\n\n\"Top-n\" collaborators according to various summaries can again be computed\n```{r aut_summaries, warning = FALSE}\nauthor_summaries \u003c- summary(author_network)\nplot(author_summaries, according_to = \"n_collaborators\", top = 20)\nplot(author_summaries, according_to = \"n_packages\", top = 20)\nplot(author_summaries, according_to = \"page_rank\", top = 20)\n```\n\nWell, the usual suspects...\n\n\n#### Package dependence trees\nSince version 0.2 **cranly** includes functions for constructing and\nworking with package dependence tree objects. A package's dependence tree shows what else needs to be installed with the package in an empty package library with the package, and hence it can be used to\n+ remove unnecessary dependencies that \"drag\" with them all sorts of other packages\n+ identify packages that are heavy for the CRAN mirrors\n+ produced some neat visuals for the package\n\n\nFor example, the dependence tree of the **PlackettLuce** R package I am co-authoring is\n```{r dep_tree, screenshot.opts = list(delay = 2)}\nPL_dependence_tree \u003c- build_dependence_tree(package_network, \"PlackettLuce\")\nplot(PL_dependence_tree)\n```\n\n**cranly** also implements a *package dependence index* (see ?summary.cranly_dependence_tree for mathematical details). The closer that is to 0 the \"lighter\" the package is\n```{r}\nsummary(PL_dependence_tree)\n```\n\nCheck the package vignettes for a more comprehensive tour of the package and for network visualizations on authors with orders of magnitude larger collaboration networks than mine.\n\n### Code of Conduct\n\nPlease note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikosmidis%2Fcranly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fikosmidis%2Fcranly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fikosmidis%2Fcranly/lists"}