-
Notifications
You must be signed in to change notification settings - Fork 31
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
pkg_score returns different value if metic is NA
and weights are set explicitly
#293
Comments
Small reprex
|
Whoops, I wrote up a reprex too, not knowing that @Jeff-Thompson12 had already done the same. I'll just share it anyway. Instead of just toggling one metric with an library(dplyr)
library(riskmetric)
packageVersion("riskmetric")
> [1] ‘0.2.2’
assessed <- "dplyr" %>%
pkg_ref(source = "pkg_cran_remote", repos = c("https://cran.rstudio.com")) %>%
as_tibble() %>%
pkg_assess()
initial_scoring <- assessed %>% pkg_score()
initial_scoring$pkg_score %>% round(2)
> [1] 0.45
# riskmetric doesn't appear to be picking up certain metrics
# so we'll set their weights to zero here.
metric_scores <- initial_scoring %>%
select(-c(package, version, pkg_ref, pkg_score)) %>%
t
> metric_scores
[,1]
bugs_status 0.53333333
covr_coverage NA
size_codebase NA
export_help NA
r_cmd_check NA
dependencies 0.01098694
reverse_dependencies 1.00000000
license NA
has_maintainer 1.00000000
remote_checks 0.88461538
exported_namespace NA
has_website 1.00000000
downloads_1yr 0.99339687
has_news 1.00000000
has_vignettes 1.00000000
has_examples NA
has_source_control 1.00000000
has_bug_reports_url 1.00000000
news_current 1.00000000
metric_weights <- ifelse(is.na(metric_scores[,1]), 0, 1)
# re-score the pkg, explicitly setting NAs with a new weight = 0
assessed %>%
pkg_score(weights = metric_weights) %>%
pull("pkg_score") %>%
round(2)
> [1] 0.13 |
To summarize a few things after reproducing this bug as well as digging through the problematic functions:
|
Bumping this "squishy spot" in |
No description provided.
The text was updated successfully, but these errors were encountered: