pharmaR / riskmetric

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

cannot force pkg_assess output to tibble when all bugs_status is missing #302

Open emilliman5 opened 11 months ago

emilliman5 commented 11 months ago

If a package does not have a bug reports URL then it produces an error, which is captured, when trying to cache bug report status'. This propagates, as expected, to the pkg_assess output. However, if all packages in the ref_cache object return this error then pkg_assess %>% as_tibble() returns an error. And furthermore, the output of pkg_assess is not easily understood when inspecting.

This raises a bigger question of how do we assess/score when we do not expect any information. In this case, the package has no BugReports URL so we know there will be no bug closures. Do should we score the bug closures anyway as 0 (could be considered double dipping), or do we mark NA so that the package only gets penalized once for not having bug reporting?

pr <- pkg_ref(c('abe' ,'abbreviate' ,'ABPS' ,'abcrf' ,'AcceptanceSampling' ,'accept'), 
                        source="pkg_cran_remote", 
                        repos="https://cran.rstudio.com") %>% 
pkg_assess() %>% 
as_tibble()

Error in as_tibble(): ! All columns in a tibble must be vectors. ✖ Column bugs_status is a pkg_metric_error/pkg_metric_condition/pkg_metric_last_30_bugs_status/pkg_metric/with_eval_recording/simpleError/error/condition object. ✖ Column has_examples is a pkg_metric_error/pkg_metric_condition/pkg_metric_has_examples/pkg_metric/with_eval_recording/simpleError/error/condition object.