-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically generating package information from a smaller list #14
Labels
enhancement
New feature or request
Comments
The R function |
Yes! So something like this: packageDescription("naniar", fields = "Description")
#> [1] "Missing values are ubiquitous in data and need to be explored and\n handled in the initial stages of analysis. 'naniar' provides data structures \n and functions that facilitate the plotting of missing values and examination \n of imputations. This allows missing data dependencies to be explored with \n minimal deviation from the common work patterns of 'ggplot2' and tidy data. " Created on 2019-09-24 by the reprex package (v0.3.0) |
Here is an example of how to do this: library(glue)
library(stringr)
library(tibble)
library(purrr)
get_desc <- function(pkg){
if (!requireNamespace(pkg, quietly = TRUE)) {
stop(glue::glue("The package {pkg} is not installed"))
}
packageDescription(pkg, fields = "Description") %>%
stringr::str_remove_all("\n") %>%
stringr::str_remove_all(" ") %>%
stringr::str_trim()
}
df_pkg <- tibble(pkgs = c("naniar", "mice", "mi"),
desc = map_chr(pkgs, get_desc))
df_pkg
#> # A tibble: 3 x 2
#> pkgs desc
#> <chr> <chr>
#> 1 naniar Missing values are ubiquitous in data and need to be explored and…
#> 2 mice Multiple imputation using Fully Conditional Specification (FCS)im…
#> 3 mi The mi package provides functions for data manipulation, imputing… Created on 2019-09-24 by the reprex package (v0.3.0) |
tuxette
pushed a commit
that referenced
this issue
Oct 29, 2019
solved in page rpkg. What remains to do:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@imkemayer and @SteffenMoritz: do you have any thoughts on how / if the package information can be added with some reference to a CRAN package link? Or would each page need to be generated manually?
Tools like
pkgdown
demonstrate that we could probably generate a short package description from a github/CRAN link. Hopefully that should mean that we don't have to generate the package description material each time.The text was updated successfully, but these errors were encountered: