dverse::document_universe()
creates a data frame with
the documentation of a collection of R packages.
url_template
links each topic
in each
package
with its corresponding documentation online.
library(dplyr, warn.conflicts = FALSE)
# Universe
library(glue)
library(tibble)
packages <- c("glue", "tibble")
url_template <- "https://{package}.tidyverse.org/reference/{topic}.html"
docs <- dverse::document_universe(packages, url_template)
docs
#> # A tibble: 46 × 7
#> topic alias title concept type keyword package
#> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 <a href=https://tibble.tidyverse.o… add_… Add … additi… help NA tibble
#> 2 <a href=https://tibble.tidyverse.o… add_… Add … additi… help NA tibble
#> 3 <a href=https://glue.tidyverse.org… as_g… Coer… NA help NA glue
#> 4 <a href=https://tibble.tidyverse.o… as_t… Coer… NA help NA tibble
#> 5 <a href=https://tibble.tidyverse.o… char… Form… vector… help NA tibble
#> 6 <a href=https://tibble.tidyverse.o… depr… Depr… NA help intern… tibble
#> 7 digits digi… Comp… NA vign… NA tibble
#> 8 <a href=https://tibble.tidyverse.o… enfr… Conv… NA help NA tibble
#> 9 engines engi… Cust… NA vign… NA glue
#> 10 extending exte… Exte… NA vign… NA tibble
#> # ℹ 36 more rows
Pick rows and columns to organize the documentation however you like
(e.g. by package
or type
).
pick <- docs %>%
filter(type == "help", keyword != "internal" | is.na(keyword)) %>%
select(topic, title, package)
pick
#> # A tibble: 28 × 3
#> topic title package
#> <chr> <chr> <chr>
#> 1 <a href=https://tibble.tidyverse.org/reference/add_column.html… Add … tibble
#> 2 <a href=https://tibble.tidyverse.org/reference/add_row.html>ad… Add … tibble
#> 3 <a href=https://glue.tidyverse.org/reference/as_glue.html>as_g… Coer… glue
#> 4 <a href=https://tibble.tidyverse.org/reference/as_tibble.html>… Coer… tibble
#> 5 <a href=https://tibble.tidyverse.org/reference/char.html>char<… Form… tibble
#> 6 <a href=https://tibble.tidyverse.org/reference/enframe.html>en… Conv… tibble
#> 7 <a href=https://tibble.tidyverse.org/reference/formatting.html… Prin… tibble
#> 8 <a href=https://tibble.tidyverse.org/reference/frame_matrix.ht… Row-… tibble
#> 9 <a href=https://glue.tidyverse.org/reference/glue.html>glue</a> Form… glue
#> 10 <a href=https://glue.tidyverse.org/reference/glue_col.html>glu… Cons… glue
#> # ℹ 18 more rows
You may generate a clickable table with DT::datatable()
,
which offers great options and features such as a search box.
options <- list(dom = "fti", search = list(search = "glue"))
DT::datatable(pick, escape = FALSE, rownames = NULL, options = options)
See ?DT::datatable()
for more options.