pharmaR / riskmetric

Metrics to evaluate the risk of R packages
https://pharmar.github.io/riskmetric/
Other
156 stars 29 forks source link

`pkg_ref()` does not accept a list in `x` param #341

Open fh-kpikhart opened 2 months ago

fh-kpikhart commented 2 months ago

The docs say that pkg_ref() accepts a list of package names, but it does not.

library(dplyr)
library(riskmetric)
packageVersion("riskmetric")

[1] ‘0.2.4’

# This works
c("dplyr", "ggplot2") %>%
  pkg_ref(source = "pkg_cran_remote", repos = c("https://cran.rstudio.com"))

# This throws an error
list("dplyr", "ggplot2") %>%
  pkg_ref(source = "pkg_cran_remote", repos = c("https://cran.rstudio.com"))

Error in as_pkg_ref.default(x[i], source = source) : 
  Don't know how to convert object class 'list' to class 'pkg_ref