vignettes/siteonly/reference-tidyverse.Rmd
reference-tidyverse.Rmd
WARNING: This reference may be out of date. It aims to demonstrate pkgdoc – not to provide a search tool for the tidyverse.
Let’s pull the documentation of all core-tidyverse-packages with pkgdoc.
(docs <- reference_package(tidyverse:::core))
#> # A tibble: 393 x 5
#> topic alias title concept package
#> <chr> <chr> <chr> <chr> <chr>
#> 1 .pt .pt, .stroke Graphical units Datasets avai… ggplot2
#> 2 +.gg +, %+% Add components to a p… <NA> ggplot2
#> 3 accumulate accumulate, accumu… Accumulate intermedia… <NA> purrr
#> 4 add_column add_column Add columns to a data… addition tibble
#> 5 add_row add_row, add_case Add rows to a data fr… addition tibble
#> 6 aes aes Construct aesthetic m… <NA> ggplot2
#> 7 aes_ aes_, aes_string, … Define aesthetic mapp… <NA> ggplot2
#> 8 aes_colour… aes_colour_fill_al… Colour related aesthe… <NA> ggplot2
#> 9 aes_group_… aes_group_order, g… Aesthetics: grouping <NA> ggplot2
#> 10 aes_linety… aes_linetype_size_… Differentiation relat… <NA> ggplot2
#> # … with 383 more rows
reference_package()
and reference_concept()
include the argument url
but currently it only works if all packages are under the same GitHub organization and the url is formatted as https://{organization}.github.io/{package}/
. But we can create arbitrary links easily with glue::glue()
.
link_topic <- function(package, topic) {
glue("<a href=https://{package}.tidyverse.org/reference/{topic}>{topic}</a>")
}
link_package <- function(package) {
glue("<a href=https://{package}.tidyverse.org/index.html>{package}</a>")
}
linked <- docs %>%
mutate(
topic = link_topic(package, topic),
package = link_package(package)
)
linked
#> # A tibble: 393 x 5
#> topic alias title concept package
#> <glue> <chr> <chr> <chr> <glue>
#> 1 <a href=https://gg… .pt, .stroke Graphical units Datasets … <a href=https:/…
#> 2 <a href=https://gg… +, %+% Add components… <NA> <a href=https:/…
#> 3 <a href=https://pu… accumulate, … Accumulate int… <NA> <a href=https:/…
#> 4 <a href=https://ti… add_column Add columns to… addition <a href=https:/…
#> 5 <a href=https://ti… add_row, add… Add rows to a … addition <a href=https:/…
#> 6 <a href=https://gg… aes Construct aest… <NA> <a href=https:/…
#> 7 <a href=https://gg… aes_, aes_st… Define aesthet… <NA> <a href=https:/…
#> 8 <a href=https://gg… aes_colour_f… Colour related… <NA> <a href=https:/…
#> 9 <a href=https://gg… aes_group_or… Aesthetics: gr… <NA> <a href=https:/…
#> 10 <a href=https://gg… aes_linetype… Differentiatio… <NA> <a href=https:/…
#> # … with 383 more rows
We are now read to create a searchable table with DT::datatable()
.