Type: | Package |
Title: | Summarises Package & Function Usage |
Version: | 0.5.0 |
Description: | Consistent with 'knitr' syntax highlighting, 'usedthese' adds a summary table of package & function usage to a Quarto document and enables aggregation of usage across a website. |
License: | MIT + file LICENSE |
URL: | https://cgoo4.github.io/usedthese/, https://github.com/cgoo4/usedthese |
BugReports: | https://github.com/cgoo4/usedthese/issues |
Depends: | R (≥ 4.1) |
Imports: | cli, conflicted (≥ 1.2.0), dplyr (≥ 1.1.0), highr, httr, kableExtra, knitr, lifecycle, purrr, readr, rlang, rvest, stringr, tibble, tidyr (≥ 1.3.0), tidyselect, withr |
Suggests: | covr, rmarkdown, spelling, testthat (≥ 3.0.0), tsibble, xts |
VignetteBuilder: | knitr |
Config/testthat/edition: | 3 |
Encoding: | UTF-8 |
Language: | en-GB |
RoxygenNote: | 7.3.1 |
NeedsCompilation: | no |
Packaged: | 2024-06-26 17:13:46 UTC; carlgoodwin |
Author: | Carl Goodwin [aut, cre, cph] |
Maintainer: | Carl Goodwin <carl.goodwin@quantumjitter.com> |
Repository: | CRAN |
Date/Publication: | 2024-06-26 17:30:02 UTC |
usedthese: Summarises Package & Function Usage
Description
Consistent with 'knitr' syntax highlighting, 'usedthese' adds a summary table of package & function usage to a Quarto document and enables aggregation of usage across a website.
Author(s)
Maintainer: Carl Goodwin carl.goodwin@quantumjitter.com [copyright holder]
See Also
Useful links:
Report bugs at https://github.com/cgoo4/usedthese/issues
Summarise function usage in a single document
Description
Consistent with knitr syntax highlighting, used_here()
adds a summary
table of R package & function usage to a knitted Quarto or R Markdown
document
Usage
used_here(fil = current_input())
Arguments
fil |
If the usage summary is required in the document you are currently knitting, then no argument need be specified. If you want to create a summary by running just the code chunk, then it is necessary to specify the quoted name of the saved file. You should first load and attach the packages used in a fresh R session. |
Details
If the rendered summary includes rows where the package name is multiple packages separated by a comma, this will be due to an unresolved conflict. The recommended approach is to use the 'conflicted' package.
Value
A printed kable table with the css class "usedthese"
Examples
# Simple example which mimics a two-line script and creates
# an html table with a CSS class "usedthese"
usedthese::used_here("mean(c(1, 2, 3))\nsum(c(1, 2, 3))")
Scrape the summaries for site-wide analysis
Description
Harvests and consolidates function usage tables from pages of a Quarto website by searching for tables with the CSS class "usedthese"
Usage
used_there(url, num_links = 30)
Arguments
url |
The url to the website listing page of posts containing usage
tables created with |
num_links |
The number of links returned from the listing page may be restricted using this argument. |
Value
A tibble summarising package & function usage
Examples
# Uses a Quarto listing url to scrape & consolidate usage
used_there("https://www.quantumjitter.com/project/", 1)