Closed massimoaria closed 4 months ago
Thank you for notifying me! Will look into this in the next couple days. ððœ
@trangdata do you know of https://github.com/r-lib/urlchecker? It's super useful.
If you use https://usethis.r-lib.org/reference/use_release_issue.html to create an issue with a checklist for CRAN submission, urlchecker is one of the items (that's how I remember to run it myself).
@maelle I remembered there was a tool like that but couldn't find it!!! use_release_issue
was what I needed. Thank you!
it's the tool to remind us of all the tools :grin:
@trangdata the package returns an issue when I try to check it for CRAN submission.
library(openalexR)
library(dplyr)
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
library(ggplot2)
jours <- oa_fetch(
entity = "venues",
works_count = ">500000",
verbose = TRUE
) |>
filter(is.na(publisher)|!grepl("Elsevier", publisher)) |>
distinct(display_name, .keep_all = TRUE) |>
select(jour = display_name, x_concepts) |>
tidyr::unnest(x_concepts) |>
filter(level == 0) |>
left_join(concept_abbrev) |>
mutate(abbreviation = gsub(" ", "<br>", abbreviation)) |>
tidyr::complete(jour, abbreviation, fill = list(score = 0)) |>
group_by(jour) |>
mutate(
color = if_else(score > 10, "#1A1A1A", "#D9D9D9"), # CCCCCC
label = paste0("<span style='color:", color, "'>", abbreviation, "</span>")
)
#> Requesting url: https://api.openalex.org/venues?filter=works_count%3A%3E500000
#> Getting 1 page of results with a total of 17 records...
#> Error in `tibble::as_tibble()` at openalexR/R/oa2df.R:539:4:
#> ! Column 3 must be named.
#> Use `.name_repair` to specify repair.
#> Caused by error in `repaired_names()`:
#> ! Names can't be empty.
#> â Empty name found at location 3.
#> Backtrace:
#> â
#> 1. ââdplyr::mutate(...)
#> 2. ââdplyr::group_by(...)
#> 3. ââtidyr::complete(...)
#> 4. ââdplyr::mutate(...)
#> 5. ââdplyr::left_join(...)
#> 6. ââdplyr::filter(...)
#> 7. ââtidyr::unnest(...)
#> 8. ââdplyr::select(...)
#> 9. ââdplyr::distinct(...)
#> 10. ââdplyr::filter(...)
#> 11. ââopenalexR::oa_fetch(...)
#> 12. ââopenalexR::oa2df(...) at openalexR/R/oa_fetch.R:123:4
#> 13. ââopenalexR:::venues2df(data, verbose) at openalexR/R/oa2df.R:54:2
#> 14. ââtibble::as_tibble(c(sub_identical, sub_flat, sub_id, sub_rbind_dfs)) at openalexR/R/oa2df.R:539:4
#> 15. ââtibble:::as_tibble.list(c(sub_identical, sub_flat, sub_id, sub_rbind_dfs))
#> 16. ââtibble:::lst_to_tibble(x, .rows, .name_repair, col_lengths(x))
#> 17. ââtibble:::set_repaired_names(...)
#> 18. ââtibble:::repaired_names(...)
#> 19. ââtibble:::subclass_name_repair_errors(...)
#> 20. â ââbase::withCallingHandlers(...)
#> 21. ââvctrs::vec_as_names(...)
#> 22. ââvctrs (local) `<fn>`()
#> 23. ââvctrs:::validate_unique(names = names, arg = arg, call = call)
#> 24. ââvctrs:::stop_names_cannot_be_empty(names, call = call)
#> 25. ââvctrs:::stop_names(...)
#> 26. ââvctrs:::stop_vctrs(...)
#> 27. âârlang::abort(message, class = c(class, "vctrs_error"), ..., call = vctrs_error_call(call))
jours |>
ggplot() +
aes(fill = jour, y = score, x = abbreviation, group = jour) +
facet_wrap(~jour) +
geom_hline(yintercept = c(45, 90), colour = "grey90", linewidth = 0.2) +
geom_segment(
aes(x = abbreviation, xend = abbreviation, y = 0, yend = 100),
color = "grey95"
) +
geom_col(color = "grey20") +
coord_polar(clip = "off") +
theme_bw() +
theme(
plot.background = element_rect(fill = "transparent", colour = NA),
panel.background = element_rect(fill = "transparent", colour = NA),
panel.grid = element_blank(),
panel.border = element_blank(),
axis.text = element_blank(),
axis.ticks.y = element_blank()
) +
ggtext::geom_richtext(
aes(y = 120, label = label),
fill = NA, label.color = NA, size = 3
) +
scale_fill_brewer(palette = "Set1") +
guides(fill = "none") +
labs(y = NULL, x = NULL, title = "Journal clocks")
#> Error in ggplot(jours): object 'jours' not found
Created on 2023-03-27 with reprex v2.0.2
The same issue is also returned during the tests:
Error (test-oa2df.R:8): oa2df works
<tibble_error_column_names_cannot_be_empty/tibble_error/rlang_error/error/condition>
Error in tibble::as_tibble(c(sub_identical, sub_flat, sub_id, sub_rbind_dfs))
: Column 3 must be named.
Use .name_repair
to specify repair.
Caused by error in repaired_names()
:
! Names can't be empty.
x Empty name found at location 3.
Thank you for reporting this issue @massimoaria! ððœ It looks like openalex changed publisher to host_organization, which can be either publisher or institution depending on type. I will make a PR to address this issue.
Do you know if openalex has a public change log somewhere? I couldn't find it.
In the mean time, as Maëlle recommended, do you want to use usethis::use_release_issue to track the CRAN submission @massimoaria? ð
@trangdata I am trying to submit the new version of openalexR accepted by rOpneSci to CRAN but there are numerous invalid links to fix and other notes to fix.
Here the link to submission log: https://win-builder.r-project.org/incoming_pretest/openalexR_1.0.2.9000_20230226_213508/Windows/00check.log