
License
41 | 42 |YEAR: 2019 45 | COPYRIGHT HOLDER: Luis D. Verde Arregoita 46 |47 | 48 |
├── docs ├── CNAME ├── logo.png ├── favicon.ico ├── favicon-16x16.png ├── favicon-32x32.png ├── apple-touch-icon.png ├── reference │ ├── Rplot001.png │ ├── figures │ │ └── logo.png │ ├── annotater.html │ ├── annotate_r_version.html │ ├── annotate_active_file.html │ ├── annotate_data_active_file.html │ ├── annotate_repos_active_file.html │ ├── pkg_version.html │ ├── repo_details.html │ ├── annotate_fun_calls_active_file.html │ ├── annotate_repostitle_active.html │ └── check_pkgs.html ├── apple-touch-icon-60x60.png ├── apple-touch-icon-76x76.png ├── apple-touch-icon-120x120.png ├── apple-touch-icon-152x152.png ├── apple-touch-icon-180x180.png ├── deps │ ├── font-awesome-6.4.2 │ │ └── webfonts │ │ │ ├── fa-brands-400.ttf │ │ │ ├── fa-solid-900.ttf │ │ │ ├── fa-brands-400.woff2 │ │ │ ├── fa-regular-400.ttf │ │ │ ├── fa-solid-900.woff2 │ │ │ ├── fa-regular-400.woff2 │ │ │ ├── fa-v4compatibility.ttf │ │ │ └── fa-v4compatibility.woff2 │ ├── font-awesome-6.5.2 │ │ └── webfonts │ │ │ ├── fa-brands-400.ttf │ │ │ ├── fa-solid-900.ttf │ │ │ ├── fa-brands-400.woff2 │ │ │ ├── fa-regular-400.ttf │ │ │ ├── fa-solid-900.woff2 │ │ │ ├── fa-regular-400.woff2 │ │ │ ├── fa-v4compatibility.ttf │ │ │ └── fa-v4compatibility.woff2 │ ├── Rethink_Sans-0.4.9 │ │ ├── AMOWz4SDuXOMCPfdoglY9JQEVFi3.woff2 │ │ ├── AMOIz4SDuXOMCPfdoglY9JQEUWi1690.woff2 │ │ ├── AMOWz4SDuXOMCPfdoglY9JQEWli389k.woff2 │ │ ├── AMOIz4SDuXOMCPfdoglY9JQEUWi769174g.woff2 │ │ └── font.css │ ├── Red_Hat_Mono-0.4.9 │ │ ├── jVyY7nDnA2uf2zVvFAhhzEs-VMSjJpBTfgjwQV3Iy7bHuA.woff2 │ │ ├── jVyY7nDnA2uf2zVvFAhhzEs-VMSjJpBTfgjwQV3Iy7jHuF4Q.woff2 │ │ └── font.css │ ├── headroom-0.11.0 │ │ ├── jQuery.headroom.min.js │ │ └── headroom.min.js │ ├── data-deps.txt │ └── bootstrap-toc-1.0.1 │ │ └── bootstrap-toc.min.js ├── pkgdown.yml ├── katex-auto.js ├── link.svg ├── bootstrap-toc.css ├── docsearch.js ├── sitemap.xml ├── lightswitch.js ├── LICENSE-text.html ├── pkgdown.js ├── articles │ └── index.html ├── bootstrap-toc.js ├── 404.html ├── LICENSE.html └── authors.html ├── tests ├── testthat │ ├── testing-helpers.R │ ├── annotating_scripts │ │ └── demo-script.R │ ├── test-annotate_script.R │ ├── test-match_pkg_names.R │ ├── test-overall-annotation.R │ └── test-annotate_fun_calls.R └── testthat.R ├── vignettes ├── .gitignore └── annotater_intro.Rmd ├── R ├── annotater-package.R ├── globals.R ├── pkg_version.R ├── repo_details.R ├── annotate_script.R ├── annotate_active_file.R ├── annotate_pkg_datasets_active.R ├── annotate_repos_active_file.R ├── annotate_repostitle_active.R ├── expand_metapackages_active.R ├── annotate_fun_calls_active_file.R ├── align_annotations.R ├── annotate_r_version.R ├── match_pkg_names.R ├── annotate_pkg_calls.R ├── expand_metapackages.R ├── annotate_pkg_datasets.R ├── annotate_repo_source.R └── annotate_repostitle.R ├── LICENSE ├── man ├── figures │ └── logo.png ├── annotate_r_version.Rd ├── pkg_version.Rd ├── annotate_active_file.Rd ├── repo_details.Rd ├── check_pkgs.Rd ├── get_pkg_datasets.Rd ├── annotate_data_active_file.Rd ├── annotate_repos_active_file.Rd ├── annotate_repostitle_active.Rd ├── annotate_fun_calls_active_file.Rd ├── annotate_script.Rd ├── expand_metapackages_active_file.Rd ├── match_pkg_names.Rd ├── annotate_pkg_calls.Rd ├── expand_metapackages.Rd ├── annotate_repo_source.Rd ├── align_annotations.Rd ├── annotate_fun_calls.Rd ├── annotate_pkg_datasets.Rd ├── annotate_repostitle.Rd └── annotater-package.Rd ├── pkgdown ├── favicon │ ├── favicon.ico │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── apple-touch-icon.png │ ├── apple-touch-icon-60x60.png │ ├── apple-touch-icon-76x76.png │ ├── apple-touch-icon-120x120.png │ ├── apple-touch-icon-152x152.png │ └── apple-touch-icon-180x180.png └── _pkgdown.yml ├── CRAN-SUBMISSION ├── .gitignore ├── .Rbuildignore ├── codecov.yml ├── cran-comments.md ├── annotater.Rproj ├── NAMESPACE ├── inst └── rstudio │ └── addins.dcf ├── DESCRIPTION ├── LICENSE.md ├── NEWS.md ├── .github └── workflows │ └── rhub.yaml └── CODE_OF_CONDUCT.md /docs/CNAME: -------------------------------------------------------------------------------- 1 | annotater.liomys.mx -------------------------------------------------------------------------------- /tests/testthat/testing-helpers.R: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | -------------------------------------------------------------------------------- /R/annotater-package.R: -------------------------------------------------------------------------------- 1 | #' @keywords internal 2 | "_PACKAGE" 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2019 2 | COPYRIGHT HOLDER: Luis D. Verde Arregoita 3 | -------------------------------------------------------------------------------- /docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/logo.png -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/favicon.ico -------------------------------------------------------------------------------- /man/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/man/figures/logo.png -------------------------------------------------------------------------------- /docs/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/favicon-16x16.png -------------------------------------------------------------------------------- /docs/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/favicon-32x32.png -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(annotater) 3 | 4 | test_check("annotater") 5 | -------------------------------------------------------------------------------- /docs/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/reference/Rplot001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/reference/Rplot001.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/pkgdown/favicon/favicon.ico -------------------------------------------------------------------------------- /tests/testthat/annotating_scripts/demo-script.R: -------------------------------------------------------------------------------- 1 | # demo script 2 | library(stats) 3 | library(datasets) 4 | -------------------------------------------------------------------------------- /CRAN-SUBMISSION: -------------------------------------------------------------------------------- 1 | Version: 0.2.4 2 | Date: 2025-07-10 23:08:32 UTC 3 | SHA: c584bbc577ec71d94a62c97b17d03e77862975f2 4 | -------------------------------------------------------------------------------- /docs/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /docs/reference/figures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/reference/figures/logo.png -------------------------------------------------------------------------------- /R/globals.R: -------------------------------------------------------------------------------- 1 | # Avoid R CMD check notes with `dplyr` verbs. 2 | utils::globalVariables(c( 3 | "pkgname_clean" 4 | )) 5 | -------------------------------------------------------------------------------- /docs/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /docs/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/pkgdown/favicon/favicon-16x16.png -------------------------------------------------------------------------------- /pkgdown/favicon/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/pkgdown/favicon/favicon-32x32.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/pkgdown/favicon/apple-touch-icon.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/pkgdown/favicon/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/pkgdown/favicon/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/pkgdown/favicon/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/pkgdown/favicon/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /pkgdown/favicon/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/pkgdown/favicon/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | inst/doc 6 | /doc/ 7 | /Meta/ 8 | annotater.Rproj 9 | /.quarto/ 10 | -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.5.2/webfonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.5.2/webfonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.5.2/webfonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.5.2/webfonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.5.2/webfonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.5.2/webfonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.5.2/webfonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.5.2/webfonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.5.2/webfonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.5.2/webfonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.5.2/webfonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.5.2/webfonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.5.2/webfonts/fa-v4compatibility.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.5.2/webfonts/fa-v4compatibility.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.5.2/webfonts/fa-v4compatibility.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/font-awesome-6.5.2/webfonts/fa-v4compatibility.woff2 -------------------------------------------------------------------------------- /docs/deps/Rethink_Sans-0.4.9/AMOWz4SDuXOMCPfdoglY9JQEVFi3.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/Rethink_Sans-0.4.9/AMOWz4SDuXOMCPfdoglY9JQEVFi3.woff2 -------------------------------------------------------------------------------- /docs/deps/Rethink_Sans-0.4.9/AMOIz4SDuXOMCPfdoglY9JQEUWi1690.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/Rethink_Sans-0.4.9/AMOIz4SDuXOMCPfdoglY9JQEUWi1690.woff2 -------------------------------------------------------------------------------- /docs/deps/Rethink_Sans-0.4.9/AMOWz4SDuXOMCPfdoglY9JQEWli389k.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/Rethink_Sans-0.4.9/AMOWz4SDuXOMCPfdoglY9JQEWli389k.woff2 -------------------------------------------------------------------------------- /docs/deps/Rethink_Sans-0.4.9/AMOIz4SDuXOMCPfdoglY9JQEUWi769174g.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/Rethink_Sans-0.4.9/AMOIz4SDuXOMCPfdoglY9JQEUWi769174g.woff2 -------------------------------------------------------------------------------- /docs/deps/Red_Hat_Mono-0.4.9/jVyY7nDnA2uf2zVvFAhhzEs-VMSjJpBTfgjwQV3Iy7bHuA.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/Red_Hat_Mono-0.4.9/jVyY7nDnA2uf2zVvFAhhzEs-VMSjJpBTfgjwQV3Iy7bHuA.woff2 -------------------------------------------------------------------------------- /docs/deps/Red_Hat_Mono-0.4.9/jVyY7nDnA2uf2zVvFAhhzEs-VMSjJpBTfgjwQV3Iy7jHuF4Q.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/luisDVA/annotater/HEAD/docs/deps/Red_Hat_Mono-0.4.9/jVyY7nDnA2uf2zVvFAhhzEs-VMSjJpBTfgjwQV3Iy7jHuF4Q.woff2 -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^README\.Rmd$ 2 | ^LICENSE\.md$ 3 | ^.*\.Rproj$ 4 | ^\.Rproj\.user$ 5 | ^_pkgdown\.yml$ 6 | ^docs$ 7 | ^pkgdown$ 8 | ^codecov\.yml$ 9 | ^cran-comments\.md$ 10 | ^CRAN-SUBMISSION$ 11 | ^doc$ 12 | ^Meta$ 13 | ^CODE_OF_CONDUCT\.md$ 14 | .github 15 | -------------------------------------------------------------------------------- /docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | pandoc: '3.2' 2 | pkgdown: 2.1.1.9000 3 | pkgdown_sha: 0cb9d38d1dc25946f01ee7500be9665985d8784e 4 | articles: 5 | annotater_intro: annotater_intro.html 6 | last_built: 2025-04-07T22:13Z 7 | urls: 8 | reference: annotater.liomys.mx/reference 9 | article: annotater.liomys.mx/articles 10 | -------------------------------------------------------------------------------- /man/annotate_r_version.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_r_version.R 3 | \name{annotate_r_version} 4 | \alias{annotate_r_version} 5 | \title{Annotate R Version} 6 | \usage{ 7 | annotate_r_version() 8 | } 9 | \description{ 10 | Annotate R Version 11 | } 12 | -------------------------------------------------------------------------------- /docs/reference/annotater.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | language: R 3 | sudo: false 4 | cache: packages 5 | after_success: 6 | - Rscript -e 'covr::codecov()' 7 | coverage: 8 | status: 9 | project: 10 | default: 11 | target: auto 12 | threshold: 1% 13 | informational: true 14 | patch: 15 | default: 16 | target: auto 17 | threshold: 1% 18 | informational: true 19 | -------------------------------------------------------------------------------- /R/pkg_version.R: -------------------------------------------------------------------------------- 1 | #' Retrieve Package version 2 | #' 3 | #' Internal helper function. 4 | #' @param pkgs_col Package name. 5 | #' 6 | #' @return A character vector with the package version. 7 | #' 8 | pkg_version <- function(pkgs_col) { 9 | pkgVers <- suppressWarnings(purrr::map(pkgs_col, utils::packageDescription, fields = "Version")) 10 | purrr::flatten_chr(purrr::map(pkgVers, paste0, collapse = "/")) 11 | } 12 | -------------------------------------------------------------------------------- /man/pkg_version.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pkg_version.R 3 | \name{pkg_version} 4 | \alias{pkg_version} 5 | \title{Retrieve Package version} 6 | \usage{ 7 | pkg_version(pkgs_col) 8 | } 9 | \arguments{ 10 | \item{pkgs_col}{Package name.} 11 | } 12 | \value{ 13 | A character vector with the package version. 14 | } 15 | \description{ 16 | Internal helper function. 17 | } 18 | -------------------------------------------------------------------------------- /man/annotate_active_file.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_active_file.R 3 | \name{annotate_active_file} 4 | \alias{annotate_active_file} 5 | \title{Annotate active file} 6 | \usage{ 7 | annotate_active_file() 8 | } 9 | \value{ 10 | No return value, wraps [annotate_pkg_calls()] for access via Addin 11 | } 12 | \description{ 13 | Annotates package load calls in the active .R file 14 | } 15 | -------------------------------------------------------------------------------- /man/repo_details.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/repo_details.R 3 | \name{repo_details} 4 | \alias{repo_details} 5 | \title{Retrieve repo details} 6 | \usage{ 7 | repo_details(pkgs_col) 8 | } 9 | \arguments{ 10 | \item{pkgs_col}{Name of variable with the non-CRAN repos.} 11 | } 12 | \value{ 13 | A character vector of user names and repository names. 14 | } 15 | \description{ 16 | Internal helper function. 17 | } 18 | -------------------------------------------------------------------------------- /R/repo_details.R: -------------------------------------------------------------------------------- 1 | #' Retrieve repo details 2 | #' 3 | #' Internal helper function. 4 | #' @param pkgs_col Name of variable with the non-CRAN repos. 5 | #' 6 | #' @return A character vector of user names and repository names. 7 | #' 8 | repo_details <- function(pkgs_col) { 9 | repDets <- suppressWarnings(purrr::map(pkgs_col, utils::packageDescription, fields = c("RemoteUsername", "RemoteRepo"))) 10 | purrr::flatten_chr(purrr::map(repDets, paste0, collapse = "/")) 11 | } 12 | -------------------------------------------------------------------------------- /man/check_pkgs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_pkg_datasets.R 3 | \name{check_pkgs} 4 | \alias{check_pkgs} 5 | \title{Check if packages are installed} 6 | \usage{ 7 | check_pkgs(pkgvec) 8 | } 9 | \arguments{ 10 | \item{pkgvec}{Vector of package names} 11 | } 12 | \value{ 13 | A data frame with installation status for packages in the input text. 14 | } 15 | \description{ 16 | Check if packages are installed 17 | } 18 | -------------------------------------------------------------------------------- /R/annotate_script.R: -------------------------------------------------------------------------------- 1 | #' Annotate script 2 | #' 3 | #' @param script_file Path to an R script. 4 | #' @param pkg_field Field from package description to retrieve, defaults to 5 | #' "Title". 6 | #' 7 | #' @return Prints the annotated script to the console. 8 | #' 9 | #' @export 10 | annotate_script <- function(script_file, pkg_field = "Title") { 11 | strlines <- readr::read_file(script_file) 12 | annttd <- annotate_pkg_calls(strlines, pkg_field) 13 | writeLines(annttd) 14 | } 15 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | ## Test environments 2 | - R-hub Windows x86_64-w64-mingw32 3 | - R-hub macos R-devel x86_64-apple-darwin20 4 | - R-hub Ubuntu clang x86_64-pc-linux-gnu 5 | 6 | No ERRORs or WARNINGs 7 | 8 | ## R CMD check results 9 | No ERRORs, WARNINGs, or NOTEs. 10 | 11 | ## No dependency issues 12 | 13 | * This minor patch includes test fixes and adds robustness to pak installations of CRAN packages, addresses CRAN check errors potentially linked to the latest release of purrr 14 | -------------------------------------------------------------------------------- /man/get_pkg_datasets.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_pkg_datasets.R 3 | \name{get_pkg_datasets} 4 | \alias{get_pkg_datasets} 5 | \title{Query data from packages} 6 | \usage{ 7 | get_pkg_datasets(inst_pkgs) 8 | } 9 | \arguments{ 10 | \item{inst_pkgs}{Vector of package names} 11 | } 12 | \value{ 13 | A data frame with all the bundled data from the specified packages. 14 | } 15 | \description{ 16 | Query data from packages 17 | } 18 | -------------------------------------------------------------------------------- /annotater.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageRoxygenize: rd,collate,namespace 22 | -------------------------------------------------------------------------------- /man/annotate_data_active_file.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_pkg_datasets_active.R 3 | \name{annotate_data_active_file} 4 | \alias{annotate_data_active_file} 5 | \title{Annotate loaded data in active file} 6 | \usage{ 7 | annotate_data_active_file() 8 | } 9 | \value{ 10 | No return value, wraps [annotate_pkg_datasets()] for access via Addin 11 | } 12 | \description{ 13 | Annotates package load calls with loaded datasets in the active .R file 14 | } 15 | -------------------------------------------------------------------------------- /man/annotate_repos_active_file.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_repos_active_file.R 3 | \name{annotate_repos_active_file} 4 | \alias{annotate_repos_active_file} 5 | \title{Annotate repositories in active file} 6 | \usage{ 7 | annotate_repos_active_file() 8 | } 9 | \value{ 10 | No return value, wraps [annotate_repo_source()] for access via Addin 11 | } 12 | \description{ 13 | Annotates package load calls with repository details in the active .R file 14 | } 15 | -------------------------------------------------------------------------------- /man/annotate_repostitle_active.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_repostitle_active.R 3 | \name{annotate_repostitle_active} 4 | \alias{annotate_repostitle_active} 5 | \title{Annotate titles and repositories in active file} 6 | \usage{ 7 | annotate_repostitle_active() 8 | } 9 | \value{ 10 | No return value, wraps [annotate_repostitle()] for access via Addin 11 | } 12 | \description{ 13 | Annotates package load calls with package titles and repository details in 14 | the active .R file 15 | } 16 | -------------------------------------------------------------------------------- /man/annotate_fun_calls_active_file.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_fun_calls_active_file.R 3 | \name{annotate_fun_calls_active_file} 4 | \alias{annotate_fun_calls_active_file} 5 | \title{Annotate function calls in active file} 6 | \usage{ 7 | annotate_fun_calls_active_file() 8 | } 9 | \value{ 10 | No return value, wraps [annotate_fun_calls()] for access via Addin 11 | } 12 | \description{ 13 | Annotates package load calls with the used functions of each package in the 14 | active .R file 15 | } 16 | -------------------------------------------------------------------------------- /man/annotate_script.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_script.R 3 | \name{annotate_script} 4 | \alias{annotate_script} 5 | \title{Annotate script} 6 | \usage{ 7 | annotate_script(script_file, pkg_field = "Title") 8 | } 9 | \arguments{ 10 | \item{script_file}{Path to an R script.} 11 | 12 | \item{pkg_field}{Field from package description to retrieve, defaults to 13 | "Title".} 14 | } 15 | \value{ 16 | Prints the annotated script to the console. 17 | } 18 | \description{ 19 | Annotate script 20 | } 21 | -------------------------------------------------------------------------------- /man/expand_metapackages_active_file.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/expand_metapackages_active.R 3 | \name{expand_metapackages_active_file} 4 | \alias{expand_metapackages_active_file} 5 | \title{Expand metapackages in active file} 6 | \usage{ 7 | expand_metapackages_active_file() 8 | } 9 | \value{ 10 | No return value, wraps [expand_metapackages()] for access via Addin 11 | } 12 | \description{ 13 | Replaces metapackage load calls in the active .R file with multiple separate 14 | calls to its core packages. 15 | } 16 | -------------------------------------------------------------------------------- /tests/testthat/test-annotate_script.R: -------------------------------------------------------------------------------- 1 | context("annotating files") 2 | 3 | test_that("file exists", { 4 | expect_error(annotate_script("./annotate_script/nonexistent.R")) 5 | }) 6 | 7 | test_that("package load calls are matched", { 8 | annotated_output <- capture_output( 9 | annotate_script(script_file = "./annotating_scripts/demo-script.R") 10 | ) 11 | manual_output <- c( 12 | "# demo script 13 | library(stats) # The R Stats Package 14 | library(datasets) # The R Datasets Package 15 | " 16 | ) 17 | expect_identical(annotated_output, manual_output) 18 | }) 19 | -------------------------------------------------------------------------------- /man/match_pkg_names.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/match_pkg_names.R 3 | \name{match_pkg_names} 4 | \alias{match_pkg_names} 5 | \title{Match package names} 6 | \usage{ 7 | match_pkg_names(string_og) 8 | } 9 | \arguments{ 10 | \item{string_og}{Text string (script) with package load calls.} 11 | } 12 | \value{ 13 | A tibble with the package load calls and package names. 14 | } 15 | \description{ 16 | Match package names 17 | } 18 | \examples{ 19 | test_string <- c("library(boot)\nrequire(Matrix)") 20 | match_pkg_names(test_string) 21 | } 22 | -------------------------------------------------------------------------------- /docs/deps/headroom-0.11.0/jQuery.headroom.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * headroom.js v0.9.4 - Give your page some headroom. Hide your header until you need it 3 | * Copyright (c) 2017 Nick Williams - http://wicky.nillia.ms/headroom.js 4 | * License: MIT 5 | */ 6 | 7 | !function(a){a&&(a.fn.headroom=function(b){return this.each(function(){var c=a(this),d=c.data("headroom"),e="object"==typeof b&&b;e=a.extend(!0,{},Headroom.options,e),d||(d=new Headroom(this,e),d.init(),c.data("headroom",d)),"string"==typeof b&&(d[b](),"destroy"===b&&c.removeData("headroom"))})},a("[data-headroom]").each(function(){var b=a(this);b.headroom(b.data())}))}(window.Zepto||window.jQuery); -------------------------------------------------------------------------------- /R/annotate_active_file.R: -------------------------------------------------------------------------------- 1 | #' Annotate active file 2 | #' 3 | #' Annotates package load calls in the active .R file 4 | #' @return No return value, wraps [annotate_pkg_calls()] for access via Addin 5 | #' 6 | #' @export 7 | annotate_active_file <- function() { 8 | context <- rstudioapi::getSourceEditorContext() 9 | contents_parsed <- paste0(context$contents, sep = "\n", collapse = "") 10 | out <- annotater::annotate_pkg_calls(contents_parsed) 11 | outlines <- stringi::stri_split_lines1(out) 12 | 13 | rstudioapi::modifyRange( 14 | c(1, 1, length(context$contents) + 1, 1), 15 | paste0(append(outlines, ""), collapse = "\n"), 16 | id = context$id 17 | ) 18 | } 19 | -------------------------------------------------------------------------------- /docs/katex-auto.js: -------------------------------------------------------------------------------- 1 | // https://github.com/jgm/pandoc/blob/29fa97ab96b8e2d62d48326e1b949a71dc41f47a/src/Text/Pandoc/Writers/HTML.hs#L332-L345 2 | document.addEventListener("DOMContentLoaded", function () { 3 | var mathElements = document.getElementsByClassName("math"); 4 | var macros = []; 5 | for (var i = 0; i < mathElements.length; i++) { 6 | var texText = mathElements[i].firstChild; 7 | if (mathElements[i].tagName == "SPAN") { 8 | katex.render(texText.data, mathElements[i], { 9 | displayMode: mathElements[i].classList.contains("display"), 10 | throwOnError: false, 11 | macros: macros, 12 | fleqn: false 13 | }); 14 | }}}); 15 | -------------------------------------------------------------------------------- /R/annotate_pkg_datasets_active.R: -------------------------------------------------------------------------------- 1 | #' Annotate loaded data in active file 2 | #' 3 | #' Annotates package load calls with loaded datasets in the active .R file 4 | #' 5 | #' @return No return value, wraps [annotate_pkg_datasets()] for access via Addin 6 | #' 7 | #' @export 8 | annotate_data_active_file <- function() { 9 | context <- rstudioapi::getSourceEditorContext() 10 | contents_parsed <- paste0(context$contents, sep = "\n", collapse = "") 11 | out <- annotater::annotate_pkg_datasets(contents_parsed) 12 | outlines <- stringi::stri_split_lines1(out) 13 | 14 | rstudioapi::modifyRange( 15 | c(1, 1, length(context$contents) + 1, 1), 16 | paste0(append(outlines, ""), collapse = "\n"), 17 | id = context$id 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /R/annotate_repos_active_file.R: -------------------------------------------------------------------------------- 1 | #' Annotate repositories in active file 2 | #' 3 | #' Annotates package load calls with repository details in the active .R file 4 | #' 5 | #' @return No return value, wraps [annotate_repo_source()] for access via Addin 6 | #' 7 | #' @export 8 | annotate_repos_active_file <- function() { 9 | context <- rstudioapi::getSourceEditorContext() 10 | contents_parsed <- paste0(context$contents, sep = "\n", collapse = "") 11 | out <- annotater::annotate_repo_source(contents_parsed) 12 | outlines <- stringi::stri_split_lines1(out) 13 | 14 | rstudioapi::modifyRange( 15 | c(1, 1, length(context$contents) + 1, 1), 16 | paste0(append(outlines, ""), collapse = "\n"), 17 | id = context$id 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /man/annotate_pkg_calls.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_pkg_calls.R 3 | \name{annotate_pkg_calls} 4 | \alias{annotate_pkg_calls} 5 | \title{Annotate package calls} 6 | \usage{ 7 | annotate_pkg_calls(string_og, pkg_field = "Title") 8 | } 9 | \arguments{ 10 | \item{string_og}{Text string (script) with package load calls.} 11 | 12 | \item{pkg_field}{Field from package description to retrieve, defaults to 13 | "Title"} 14 | } 15 | \value{ 16 | Text string with package Title annotations. Will make note of 17 | packages not currently installed. 18 | } 19 | \description{ 20 | Annotate package calls 21 | } 22 | \examples{ 23 | test_string <- c("library(boot)\nrequire(tools)") 24 | annotate_pkg_calls(test_string) 25 | } 26 | -------------------------------------------------------------------------------- /R/annotate_repostitle_active.R: -------------------------------------------------------------------------------- 1 | #' Annotate titles and repositories in active file 2 | #' 3 | #' Annotates package load calls with package titles and repository details in 4 | #' the active .R file 5 | #' 6 | #' @return No return value, wraps [annotate_repostitle()] for access via Addin 7 | #' 8 | #' @export 9 | annotate_repostitle_active <- function() { 10 | context <- rstudioapi::getSourceEditorContext() 11 | contents_parsed <- paste0(context$contents, sep = "\n", collapse = "") 12 | out <- annotater::annotate_repostitle(contents_parsed) 13 | outlines <- stringi::stri_split_lines1(out) 14 | 15 | rstudioapi::modifyRange( 16 | c(1, 1, length(context$contents) + 1, 1), 17 | paste0(append(outlines, ""), collapse = "\n"), 18 | id = context$id 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /R/expand_metapackages_active.R: -------------------------------------------------------------------------------- 1 | #' Expand metapackages in active file 2 | #' 3 | #' Replaces metapackage load calls in the active .R file with multiple separate 4 | #' calls to its core packages. 5 | #' 6 | #' @return No return value, wraps [expand_metapackages()] for access via Addin 7 | #' 8 | #' @export 9 | expand_metapackages_active_file <- function() { 10 | context <- rstudioapi::getSourceEditorContext() 11 | contents_parsed <- paste0(context$contents, sep = "\n", collapse = "") 12 | out <- annotater::expand_metapackages(contents_parsed) 13 | outlines <- stringi::stri_split_lines1(out) 14 | 15 | rstudioapi::modifyRange( 16 | c(1, 1, length(context$contents) + 1, 1), 17 | paste0(append(outlines, ""), collapse = "\n"), 18 | id = context$id 19 | ) 20 | } 21 | -------------------------------------------------------------------------------- /docs/deps/Red_Hat_Mono-0.4.9/font.css: -------------------------------------------------------------------------------- 1 | /* latin-ext */ 2 | @font-face { 3 | font-family: 'Red Hat Mono'; 4 | font-style: normal; 5 | font-weight: 400; 6 | font-display: swap; 7 | src: url(jVyY7nDnA2uf2zVvFAhhzEs-VMSjJpBTfgjwQV3Iy7jHuF4Q.woff2) format('woff2'); 8 | unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; 9 | } 10 | /* latin */ 11 | @font-face { 12 | font-family: 'Red Hat Mono'; 13 | font-style: normal; 14 | font-weight: 400; 15 | font-display: swap; 16 | src: url(jVyY7nDnA2uf2zVvFAhhzEs-VMSjJpBTfgjwQV3Iy7bHuA.woff2) format('woff2'); 17 | unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; 18 | } 19 | -------------------------------------------------------------------------------- /docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | -------------------------------------------------------------------------------- /R/annotate_fun_calls_active_file.R: -------------------------------------------------------------------------------- 1 | #' Annotate function calls in active file 2 | #' 3 | #' Annotates package load calls with the used functions of each package in the 4 | #' active .R file 5 | #' 6 | #' @importFrom rstudioapi modifyRange 7 | #' @importFrom stringi stri_split_lines1 8 | #' @return No return value, wraps [annotate_fun_calls()] for access via Addin 9 | #' 10 | #' @export 11 | #' 12 | annotate_fun_calls_active_file <- function() { 13 | context <- rstudioapi::getSourceEditorContext() 14 | contents_parsed <- paste0(context$contents, sep = "\n", collapse = "") 15 | out <- annotater::annotate_fun_calls(contents_parsed) 16 | outlines <- stringi::stri_split_lines1(out) 17 | 18 | rstudioapi::modifyRange( 19 | c(1, 1, length(context$contents) + 1, 1), 20 | paste0(append(outlines, ""), collapse = "\n"), 21 | id = context$id 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /man/expand_metapackages.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/expand_metapackages.R 3 | \name{expand_metapackages} 4 | \alias{expand_metapackages} 5 | \title{Expand metapackages} 6 | \usage{ 7 | expand_metapackages(string_og) 8 | } 9 | \arguments{ 10 | \item{string_og}{text string (script) with package load calls} 11 | } 12 | \value{ 13 | Text string with metapackage load calls replaced by multiple separate 14 | calls to the core packages that make up the metapackage. Core packages will 15 | be fenced in four commenting symbols and the order follows the attachment 16 | order from each metapackage. Will make note of metapackages not currently 17 | installed. 18 | } 19 | \description{ 20 | Expand metapackages 21 | } 22 | \examples{ 23 | test_string <- c("library(tidyverse)") 24 | expand_metapackages(test_string) 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/annotate_repo_source.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_repo_source.R 3 | \name{annotate_repo_source} 4 | \alias{annotate_repo_source} 5 | \title{Annotate repository sources} 6 | \usage{ 7 | annotate_repo_source(string_og) 8 | } 9 | \arguments{ 10 | \item{string_og}{text string (script) with package load calls} 11 | } 12 | \value{ 13 | text string with package repository source annotations. Will make 14 | note of packages not currently installed. Lines with existing comments or 15 | annotations are ignored by the regular expression that matches package 16 | names. Also ignores base packages. Local installs now annotated as such. 17 | } 18 | \description{ 19 | Annotate repository sources 20 | } 21 | \examples{ 22 | test_string <- c("library(knitr)\nrequire(datasets)") 23 | annotate_repo_source(test_string) 24 | } 25 | -------------------------------------------------------------------------------- /man/align_annotations.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/align_annotations.R 3 | \name{align_annotations} 4 | \alias{align_annotations} 5 | \title{Vertical alignment of package annotations} 6 | \usage{ 7 | align_annotations( 8 | annot_string, 9 | regex_ai = paste0("(?!\\\\))(?!\\\\s)(?=\\\\#\\\\sCRAN\\\\sv|", 10 | "\\\\#\\\\sBiocon|\\\\#\\\\snot\\\\sinstall|", "\\\\#\\\\s\\\\[|\\\\#\\\\sPosit R)"), 11 | sep_str = "" 12 | ) 13 | } 14 | \arguments{ 15 | \item{annot_string}{Character vector with annotated package calls.} 16 | 17 | \item{regex_ai}{Custom regular expression to match lines with package annotations.} 18 | 19 | \item{sep_str}{Whitespace separator.} 20 | } 21 | \value{ 22 | A character vector with vertically aligned package calls. 23 | } 24 | \description{ 25 | Internal helper function, based on `unheadr::regex_valign`` 26 | } 27 | -------------------------------------------------------------------------------- /man/annotate_fun_calls.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_fun_calls.R 3 | \name{annotate_fun_calls} 4 | \alias{annotate_fun_calls} 5 | \title{Annotate function calls} 6 | \usage{ 7 | annotate_fun_calls(string_og) 8 | } 9 | \arguments{ 10 | \item{string_og}{text string (script) with package load calls} 11 | } 12 | \value{ 13 | text string with function call annotations. Will make note of 14 | packages not currently installed. Lines with existing comments or 15 | annotations are ignored by the regular expression that matches package 16 | names. Be aware that package-specific methods (e.g., print or summary 17 | methods) will be annotated too. 18 | } 19 | \description{ 20 | Annotate function calls 21 | } 22 | \examples{ 23 | test_string <- c("library(boot)\nrequire(lattice)\ncanonical.theme()") 24 | cat(annotate_fun_calls(test_string)) 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/annotate_pkg_datasets.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_pkg_datasets.R 3 | \name{annotate_pkg_datasets} 4 | \alias{annotate_pkg_datasets} 5 | \title{Annotate package datasets} 6 | \usage{ 7 | annotate_pkg_datasets(string_og) 8 | } 9 | \arguments{ 10 | \item{string_og}{text string (script) with package load calls} 11 | } 12 | \value{ 13 | text string with annotations for datasets loaded from packages 14 | explicitly, lazily, or through name-spacing. Will make note of packages not 15 | currently installed. Lines with existing comments or annotations are 16 | ignored. 17 | } 18 | \description{ 19 | Annotate package datasets 20 | } 21 | \details{ 22 | No support for \pkg{pacman} package loading at this time. 23 | } 24 | \examples{ 25 | test_string <- c("library(tidyr)\nlibrary(purrr)\ndata(construction)\nsummary(fish_encounters)") 26 | annotate_pkg_datasets(test_string) 27 | 28 | } 29 | -------------------------------------------------------------------------------- /man/annotate_repostitle.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotate_repostitle.R 3 | \name{annotate_repostitle} 4 | \alias{annotate_repostitle} 5 | \title{Annotate package titles and repository sources} 6 | \usage{ 7 | annotate_repostitle(string_og) 8 | } 9 | \arguments{ 10 | \item{string_og}{Text string (script) with package load calls.} 11 | } 12 | \value{ 13 | Text string with package titles and package repository source 14 | annotations. Will make note of packages not currently installed. Lines with 15 | existing comments or annotations are ignored by the regular expression that 16 | matches package names. Also ignores base packages. 17 | } 18 | \description{ 19 | Annotate package titles and repository sources 20 | } 21 | \details{ 22 | Some annotations may be long, check for possible line breaks 23 | introduced into your script. 24 | } 25 | \examples{ 26 | test_string <- c("library(knitr)\nrequire(datasets)") 27 | annotate_repostitle(test_string) 28 | } 29 | -------------------------------------------------------------------------------- /docs/deps/data-deps.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(annotate_active_file) 4 | export(annotate_data_active_file) 5 | export(annotate_fun_calls) 6 | export(annotate_fun_calls_active_file) 7 | export(annotate_pkg_calls) 8 | export(annotate_pkg_datasets) 9 | export(annotate_repo_source) 10 | export(annotate_repos_active_file) 11 | export(annotate_repostitle) 12 | export(annotate_repostitle_active) 13 | export(annotate_script) 14 | export(expand_metapackages) 15 | export(expand_metapackages_active_file) 16 | export(match_pkg_names) 17 | importFrom(dplyr,`%>%`) 18 | importFrom(dplyr,distinct) 19 | importFrom(dplyr,filter) 20 | importFrom(dplyr,pull) 21 | importFrom(knitr,purl) 22 | importFrom(purrr,map) 23 | importFrom(rlang,.data) 24 | importFrom(rstudioapi,getSourceEditorContext) 25 | importFrom(rstudioapi,insertText) 26 | importFrom(rstudioapi,modifyRange) 27 | importFrom(rstudioapi,versionInfo) 28 | importFrom(stringi,stri_replace_all_fixed) 29 | importFrom(stringi,stri_split_lines1) 30 | importFrom(stringr,str_detect) 31 | importFrom(tibble,rowid_to_column) 32 | importFrom(utils,sessionInfo) 33 | -------------------------------------------------------------------------------- /inst/rstudio/addins.dcf: -------------------------------------------------------------------------------- 1 | Name: Annotate package calls in active file 2 | Description: Describes the packages being loaded 3 | Binding: annotate_active_file 4 | Interactive: false 5 | 6 | Name: Annotate package repository sources in active file 7 | Description: Adds source and version numbers 8 | Binding: annotate_repos_active_file 9 | Interactive: false 10 | 11 | Name: Annotate titles and repository sources in active file 12 | Description: Adds titles, sources, and versions 13 | Binding: annotate_repostitle_active 14 | Interactive: false 15 | 16 | Name: Annotate each package's function calls 17 | Description: Adds used functions 18 | Binding: annotate_fun_calls_active_file 19 | Interactive: false 20 | 21 | Name: Annotate loaded datasets 22 | Description: Adds loaded data 23 | Binding: annotate_data_active_file 24 | Interactive: false 25 | 26 | Name: Expand metapackages 27 | Description: Expand into separate load calls 28 | Binding: expand_metapackages_active_file 29 | Interactive: false 30 | 31 | Name: Annotate with R version 32 | Description: Adds R version, running OS and RStudio version 33 | Binding: annotate_r_version 34 | Interactive: false 35 | -------------------------------------------------------------------------------- /man/annotater-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/annotater-package.R 3 | \docType{package} 4 | \name{annotater-package} 5 | \alias{annotater} 6 | \alias{annotater-package} 7 | \title{annotater: Annotate Package Load Calls} 8 | \description{ 9 | \if{html}{\figure{logo.png}{options: style='float: right' alt='logo' width='120'}} 10 | 11 | Provides non-invasive annotation of package load calls such as \code{library()}, \code{p_load()}, and \code{require()} so that we can have an idea of what the packages we are loading are meant for. 12 | } 13 | \seealso{ 14 | Useful links: 15 | \itemize{ 16 | \item \url{https://github.com/luisDVA/annotater} 17 | \item \url{https://annotater.liomys.mx} 18 | \item Report bugs at \url{https://github.com/luisDVA/annotater/issues} 19 | } 20 | 21 | } 22 | \author{ 23 | \strong{Maintainer}: Luis D. Verde Arregoitia \email{luis@liomys.mx} (\href{https://orcid.org/0000-0001-9520-6543}{ORCID}) 24 | 25 | Other contributors: 26 | \itemize{ 27 | \item Juan Cruz Rodriguez [contributor] 28 | \item Hadley Wickham [contributor] 29 | } 30 | 31 | } 32 | \keyword{internal} 33 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: annotater 2 | Title: Annotate Package Load Calls 3 | Version: 0.2.4 4 | Authors@R: c( 5 | person(given = "Luis D.", 6 | family = "Verde Arregoitia", 7 | role = c("aut", "cre"), 8 | email = "luis@liomys.mx", 9 | comment = c(ORCID = "0000-0001-9520-6543")), 10 | person("Juan","Cruz Rodriguez",role="ctb"), 11 | person("Hadley","Wickham",role="ctb")) 12 | Description: Provides non-invasive annotation of package load calls 13 | such as \code{library()}, \code{p_load()}, and \code{require()} so that we can have an idea of what 14 | the packages we are loading are meant for. 15 | License: MIT + file LICENSE 16 | Encoding: UTF-8 17 | LazyData: true 18 | RoxygenNote: 7.3.2 19 | Imports: 20 | dplyr, 21 | knitr, 22 | purrr, 23 | readr, 24 | rlang, 25 | rstudioapi, 26 | stringi, 27 | stringr, 28 | tibble, 29 | tidyr 30 | URL: https://github.com/luisDVA/annotater, https://annotater.liomys.mx 31 | BugReports: https://github.com/luisDVA/annotater/issues 32 | Suggests: 33 | covr, 34 | rmarkdown, 35 | testthat 36 | VignetteBuilder: knitr 37 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2019 Luis D. Verde Arregoita 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pkgdown/_pkgdown.yml: -------------------------------------------------------------------------------- 1 | title: annotater 2 | url: annotater.liomys.mx 3 | 4 | template: 5 | bootstrap: 5 6 | light-switch: true 7 | bslib: 8 | primary: "#0054AD" 9 | border-radius: 0.5rem 10 | btn-border-radius: 0.25rem 11 | danger: "#A6081A" 12 | base_font: 13 | google: {family: "Rethink Sans", wght: [400, 500, 700], ital: [0, 1]} 14 | code_font: {google: "Red Hat Mono"} 15 | 16 | reference: 17 | - title: Annotation builders 18 | desc: 19 | contents: 20 | - '`annotate_pkg_calls`' 21 | - '`annotate_pkg_datasets`' 22 | - '`annotate_repo_source`' 23 | - '`annotate_script`' 24 | - '`annotate_fun_calls`' 25 | - '`expand_metapackages`' 26 | - '`match_pkg_names`' 27 | - '`annotate_r_version`' 28 | - title: RStudio addins 29 | desc: 30 | contents: 31 | - '`annotate_active_file`' 32 | - '`annotate_repos_active_file`' 33 | - '`annotate_repostitle_active`' 34 | - '`annotate_fun_calls_active_file`' 35 | - '`annotate_data_active_file`' 36 | - '`expand_metapackages_active_file`' 37 | - '`annotate_r_version`' 38 | - title: Helper functions 39 | desc: 40 | contents: 41 | - '`align_annotations`' 42 | - '`annotate_repostitle`' 43 | - '`pkg_version`' 44 | - '`repo_details`' 45 | - '`check_pkgs`' 46 | - '`get_pkg_datasets`' 47 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | # annotater 0.2.4 2 | 3 | * Make annotations robust to CRAN packages installed with pak 4 | * Examples that work better in the minimal checking environments 5 | 6 | # annotater 0.2.3 7 | 8 | * Fix failing tests 9 | * Better annotations for packages installed from R-universe and RSPM 10 | * Dataset annotation added 11 | * Modern tidyselect syntax (thanks to PR by Hadley Wickham) 12 | 13 | # annotater 0.2.2 14 | 15 | * Bug fixes 16 | * Add function to expand metapackages 17 | * Fix failing test affecting purrr 18 | 19 | # annotater 0.2.1 20 | 21 | * Additional unit tests 22 | * Preparation for CRAN submission 23 | * Metapackage disclaimer in documentation 24 | 25 | # annotater 0.2.0 26 | 27 | * Adds support for packages loaded with the `pacman` package 28 | 29 | * Fixes library load call matching for indented code 30 | 31 | # annotater 0.1.3 32 | 33 | * Added the `annotate_fun_calls` annotator, cooler logo, and support for quoted package names. 34 | 35 | # annotater 0.1.2 36 | 37 | * Repo sources vertically aligned for nicer annotations. 38 | 39 | # annotater 0.1.1 40 | 41 | * Better notation for `annotate_repo_source()` and package versions added to annotation text. 42 | 43 | # annotater 0.1.0 44 | 45 | * Added a `NEWS.md` file to track changes to the package. 46 | 47 | * `annotate_repo_source()` and its corresponding addin now support packages from GitHub, GitLab, CRAN, and Bioconductor. 48 | -------------------------------------------------------------------------------- /R/align_annotations.R: -------------------------------------------------------------------------------- 1 | #' Vertical alignment of package annotations 2 | #' 3 | #' Internal helper function, based on `unheadr::regex_valign`` 4 | #' 5 | #' @param annot_string Character vector with annotated package calls. 6 | #' @param regex_ai Custom regular expression to match lines with package annotations. 7 | #' @param sep_str Whitespace separator. 8 | #' @return A character vector with vertically aligned package calls. 9 | #' 10 | align_annotations <- function(annot_string, 11 | regex_ai = paste0( 12 | "(?!\\))(?!\\s)(?=\\#\\sCRAN\\sv|", 13 | "\\#\\sBiocon|\\#\\snot\\sinstall|", 14 | "\\#\\s\\[|\\#\\sPosit R)"), 15 | sep_str = "") { 16 | if (!is.character(annot_string)) { 17 | stop("input 'stringvec' must be a character vector") 18 | } 19 | stringvec <- unlist(strsplit(annot_string, "\n")) 20 | match_position <- regexpr(regex_ai, stringvec, 21 | perl = TRUE, 22 | ignore.case = TRUE 23 | ) 24 | padding <- function(x) { 25 | padspacing <- paste(rep.int(" ", max(x)), collapse = "") 26 | substring(padspacing, 0L, x) 27 | } 28 | nspaces <- padding(max(match_position) - match_position) 29 | for (i in seq_along(stringvec)) { 30 | stringvec[i] <- sub(regex_ai, nspaces[i], stringvec[i], 31 | perl = TRUE, ignore.case = TRUE 32 | ) 33 | } 34 | lines_out <- sub(regex_ai, sep_str, stringvec, perl = TRUE, ignore.case = TRUE) 35 | paste0(lines_out, collapse = "\n") 36 | } 37 | -------------------------------------------------------------------------------- /tests/testthat/test-match_pkg_names.R: -------------------------------------------------------------------------------- 1 | context("Matching library load calls") 2 | 3 | test_that("input is a character string", { 4 | expect_error(match_pkg_names(1234)) 5 | }) 6 | 7 | test_that("library and require calls are matched", { 8 | test_string <- c("library(boot)\nrequire(tools)") 9 | matched <- match_pkg_names(test_string) 10 | manual_pkg_table <- tibble::tribble( 11 | ~call, ~package_name, ~pkgname_clean, 12 | "library(boot)", "boot", "boot", 13 | "require(tools)", "tools", "tools" 14 | ) 15 | expect_identical(matched, manual_pkg_table) 16 | }) 17 | 18 | test_that("commented lines are skipped", { 19 | test_string <- c("library(boot)\nlibrary(unheadr) # comment\nrequire(tools)") 20 | matched <- match_pkg_names(test_string) 21 | manual_pkg_table <- tibble::tribble( 22 | ~call, ~package_name, ~pkgname_clean, 23 | "library(boot)", "boot", "boot", 24 | "require(tools)", "tools", "tools" 25 | ) 26 | expect_identical(matched, manual_pkg_table) 27 | }) 28 | 29 | test_that("quoted packaged names stripped for matching", { 30 | test_string <- c('library("boot")\nrequire(tools)') 31 | matched <- match_pkg_names(test_string) 32 | manual_pkg_table <- tibble::tribble( 33 | ~call, ~package_name, ~pkgname_clean, 34 | "library(\"boot\")", "\"boot\"", "boot", 35 | "require(tools)", "tools", "tools" 36 | ) 37 | expect_identical(matched, manual_pkg_table) 38 | }) 39 | 40 | test_that("line breaks in pacman calls trigger message", { 41 | test_string <- c("p_load(\nboot,unheadr)") 42 | expect_message(match_pkg_names(test_string)) 43 | }) 44 | -------------------------------------------------------------------------------- /R/annotate_r_version.R: -------------------------------------------------------------------------------- 1 | #' Annotate R Version 2 | #' 3 | #' @importFrom rstudioapi getSourceEditorContext insertText versionInfo 4 | #' @importFrom utils sessionInfo 5 | #' 6 | annotate_r_version <- function() { 7 | context <- getSourceEditorContext() 8 | # Get and parse R session info. 9 | session_info <- sessionInfo() 10 | session_info <- paste0( 11 | "# ", session_info$R.version$version.string, "\n", 12 | "# Platform: ", session_info$platform, "\n", 13 | "# Running under: ", session_info$running, "\n" 14 | ) 15 | # Get and parse RStudio version info (if installed). 16 | rstudio_info <- try(versionInfo(), silent = TRUE) 17 | if (inherits(rstudio_info, "try-error")) { 18 | rstudio_info <- "" 19 | } else { 20 | rstudio_info <- paste0( 21 | "# Rstudio ", rstudio_info$version, " (", rstudio_info$release_name, ")\n" 22 | ) 23 | session_info <- paste0(session_info, rstudio_info) 24 | } 25 | insert_code_position <- c(1, 1) 26 | # It will annotate after the first "```{r", "```{r," or "```{r ". 27 | markdown_first_r_chunk <- grep("^```\\{r(}| |,)", context$contents) 28 | if (length(markdown_first_r_chunk) > 0) { 29 | # If we found a "```", it means this is not a valid R file, so we consider it's a markdown. 30 | insert_code_position <- markdown_first_r_chunk[[1]] + 1 31 | # If this is a quarto file, we should skip the lines starting with "#|" after the "```". 32 | while (insert_code_position <= length(context$contents) && 33 | grepl("^#| ", context$contents[[insert_code_position]])) { 34 | insert_code_position <- insert_code_position + 1 35 | } 36 | insert_code_position <- c(insert_code_position, 1) 37 | } 38 | insertText(insert_code_position, paste0(session_info, "# \n"), id = context$id) 39 | } 40 | -------------------------------------------------------------------------------- /docs/bootstrap-toc.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) 3 | * Copyright 2015 Aidan Feldman 4 | * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ 5 | 6 | /* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ 7 | 8 | /* All levels of nav */ 9 | nav[data-toggle='toc'] .nav > li > a { 10 | display: block; 11 | padding: 4px 20px; 12 | font-size: 13px; 13 | font-weight: 500; 14 | color: #767676; 15 | } 16 | nav[data-toggle='toc'] .nav > li > a:hover, 17 | nav[data-toggle='toc'] .nav > li > a:focus { 18 | padding-left: 19px; 19 | color: #563d7c; 20 | text-decoration: none; 21 | background-color: transparent; 22 | border-left: 1px solid #563d7c; 23 | } 24 | nav[data-toggle='toc'] .nav > .active > a, 25 | nav[data-toggle='toc'] .nav > .active:hover > a, 26 | nav[data-toggle='toc'] .nav > .active:focus > a { 27 | padding-left: 18px; 28 | font-weight: bold; 29 | color: #563d7c; 30 | background-color: transparent; 31 | border-left: 2px solid #563d7c; 32 | } 33 | 34 | /* Nav: second level (shown on .active) */ 35 | nav[data-toggle='toc'] .nav .nav { 36 | display: none; /* Hide by default, but at >768px, show it */ 37 | padding-bottom: 10px; 38 | } 39 | nav[data-toggle='toc'] .nav .nav > li > a { 40 | padding-top: 1px; 41 | padding-bottom: 1px; 42 | padding-left: 30px; 43 | font-size: 12px; 44 | font-weight: normal; 45 | } 46 | nav[data-toggle='toc'] .nav .nav > li > a:hover, 47 | nav[data-toggle='toc'] .nav .nav > li > a:focus { 48 | padding-left: 29px; 49 | } 50 | nav[data-toggle='toc'] .nav .nav > .active > a, 51 | nav[data-toggle='toc'] .nav .nav > .active:hover > a, 52 | nav[data-toggle='toc'] .nav .nav > .active:focus > a { 53 | padding-left: 28px; 54 | font-weight: 500; 55 | } 56 | 57 | /* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ 58 | nav[data-toggle='toc'] .nav > .active > ul { 59 | display: block; 60 | } 61 | -------------------------------------------------------------------------------- /docs/deps/bootstrap-toc-1.0.1/bootstrap-toc.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Table of Contents v1.0.1 (http://afeld.github.io/bootstrap-toc/) 3 | * Copyright 2015 Aidan Feldman 4 | * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ 5 | !function(a){"use strict";window.Toc={helpers:{findOrFilter:function(e,t){var n=e.find(t);return e.filter(t).add(n).filter(":not([data-toc-skip])")},generateUniqueIdBase:function(e){return a(e).text().trim().replace(/\'/gi,"").replace(/[& +$,:;=?@"#{}|^~[`%!'<>\]\.\/\(\)\*\\\n\t\b\v]/g,"-").replace(/-{2,}/g,"-").substring(0,64).replace(/^-+|-+$/gm,"").toLowerCase()||e.tagName.toLowerCase()},generateUniqueId:function(e){for(var t=this.generateUniqueIdBase(e),n=0;;n++){var r=t;if(0
YEAR: 2019 45 | COPYRIGHT HOLDER: Luis D. Verde Arregoita 46 |47 | 48 |


Annotate R Version
47 |Copyright (c) 2019 Luis D. Verde Arregoita
47 |Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
48 |The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
49 |THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
50 |Annotates package load calls in the active .R file
47 |
R/annotate_pkg_datasets_active.R
42 | annotate_data_active_file.RdAnnotates package load calls with loaded datasets in the active .R file
47 |
R/annotate_repos_active_file.R
42 | annotate_repos_active_file.RdAnnotates package load calls with repository details in the active .R file
47 |Internal helper function.
47 |Internal helper function.
47 |
R/annotate_fun_calls_active_file.R
44 | annotate_fun_calls_active_file.RdAnnotates package load calls with the used functions of each package in the 49 | active .R file
50 |
R/annotate_repostitle_active.R
44 | annotate_repostitle_active.RdAnnotates package load calls with package titles and repository details in 49 | the active .R file
50 |Check if packages are installed
47 |