pharmaR / riskassessment

Risk Assessment Demo App: https://rinpharma.shinyapps.io/riskassessment
https://pharmar.github.io/riskassessment/
Other
98 stars 26 forks source link

Add ability to add custom urls for fetching package metadata from #659

Open narayanan-iyer-pfizer opened 9 months ago

narayanan-iyer-pfizer commented 9 months ago

For Rstudio (posit) managed repos, users might want to use that to fetch data from and that repo hosts internal packages not found elsewhere, so we might want to add an option for the user to supply a custom url.

AARON-CLARK commented 9 months ago

Since {riskmetric} respects the users options(repos) statement throughout the package, we made an intentional decision to follow that precedent as well when calling riskmetric::pkg_ref(). We used to manually override by specifying a repos arg here, but now we don't so that URLs specified in options(repos) will shine. @Jeff-Thompson12, can you confirm?

Although, source = "pkg_cran_remote" will obviously not work well for assessing an internal pkg. Does that answer your question @narayanan-iyer-pfizer? In the future, I think we'll eventually be able to run the app with a pkg_source source for internal pkgs.

Jeff-Thompson12 commented 9 months ago

I can confirm that we switched to using options(repos) because there are {riskmetric} functions that implicitly call getOption(repos). While we can allow for a user to specify a different CRAN-like repository, it does pose a problem of comparing apples and oranges because some of the metrics will still be pointing to an actual CRAN mirror. (For example, an organization could have a special version of an R package but {riskmetric} will still be grabbing download numbers from public data.) For this reason, we have to date not allowed users to specify their own repo.

The problem of allowing users to make assessments for installed or source packages is still an open issue. It's solution would probably alleviate some of the issues stated above.