-
Notifications
You must be signed in to change notification settings - Fork 108
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
assert_package()
didn't return min version
#1296
Comments
Similarly, |
I think it'll work better to use |
I'm not sure to see your point. You will still have to parse the DESCRIPTION of the package returned by |
The returned object from df_pkg_details <-
installed.packages() |>
tibble::as_tibble() |>
dplyr::filter(Package == "gtsummary") |>
dplyr::select(Depends, Imports, LinkingTo, Suggests, Enhances)
df_pkg_details$Suggests
#> [1] "aod (>= 1.3.1), broom.mixed (>= 0.2.7), car (>= 3.0-11),\ncmprsk, covr, effectsize (>= 0.6.0), emmeans (>= 1.7.3),\nflextable (>= 0.6.10), geepack, GGally (>= 2.1.0), Hmisc,\nhuxtable (>= 5.4.0), insight (>= 0.15.0), kableExtra (>=\n1.3.4), lme4, mgcv, mice (>= 3.10.0), nnet, officer, openxlsx,\nparameters (>= 0.18.1), parsnip (>= 0.1.7), rmarkdown, sandwich\n(>= 3.0.1), scales, smd (>= 0.6.6), spelling (>= 2.2), survey,\nsurvival (>= 3.2-11), testthat (>= 3.0.4), tidycmprsk (>=\n0.1.2), workflows (>= 0.2.4)" Created on 2022-07-19 by the reprex package (v2.0.1) |
Would something like that be useful in library(tidyverse)
.get_dependencies <- function(pkg = "broom.helpers") {
utils::installed.packages() %>%
tibble::as_tibble() %>%
dplyr::filter(.data$Package == .env$pkg) %>%
dplyr::select(dplyr::all_of(c("Imports", "Depends", "Suggests", "Enhances", "LinkingTo"))) %>%
tidyr::pivot_longer(dplyr::everything(), values_to = "package", names_to = "dependency_type") %>%
tidyr::separate_rows(.data$package, sep = ",") %>%
dplyr::mutate(package = stringr::str_squish(.data$package)) %>%
tidyr::separate(.data$package, into = c("package", "version"), sep = " ", extra = "merge", fill = "right") %>%
dplyr::filter(!is.na(.data$package))
}
.get_dependencies() %>% knitr::kable()
.get_dependencies("gtsummary") %>% knitr::kable()
Created on 2022-07-19 by the reprex package (v2.0.1) |
I think this a great function to include, and we can update |
This comment was marked as outdated.
This comment was marked as outdated.
new function `.get_package_dependencies()` `.assert_package()` now checks the type of comparison for minimum version cf. ddsjoberg/gtsummary#1296
You may have a look at larmarange/broom.helpers#171 New function
The comparison operator is taken into account by |
Created on 2022-07-19 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: