Skip to content

Commit

Permalink
Fix checks
Browse files Browse the repository at this point in the history
Fixes #314
  • Loading branch information
raffaem committed Feb 4, 2025
1 parent 64dfd4b commit df910d0
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ LazyData: true
RoxygenNote: 7.3.2
Config/testthat/edition: 3
Depends:
R (>= 2.10)
R (>= 3.5)
10 changes: 5 additions & 5 deletions R/oa_fetch.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ oa_entities <- function() {
#' The argument is ignored if entity is different from "works".
#' @param output Character.
#' Type of output, one of `"tibble"`, `"dataframe"`, `"list"`, or `"raw"`.
##' \itemize{
##' \item{"tibble"}: {a tibble tidy data}
##' \item{"dataframe"}: {a base data.frame tidy data}
##' \item{"list"}: {a list of parsed JSON contents}
##' \item{"raw"}: {a list of raw JSON strings (length depends on query)}
##' \describe{
##' \item{tibble}{a tibble tidy data}
##' \item{dataframe}{a base data.frame tidy data}
##' \item{list}{a list of parsed JSON contents}
##' \item{raw}{a list of raw JSON strings (length depends on query)}
##' }
#'
#' @return A data.frame or a list. Result of the query.
Expand Down
3 changes: 2 additions & 1 deletion data-raw/coverage-works.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
original,oa2df,comment
abstract_inverted_index,abstract,reconstructed from inverted index
abstract_inverted_index_v3,NA,
apc_list.currency,apc.currency,
apc_list.provenance,apc.provenance,
apc_list.value,apc.value,
Expand Down Expand Up @@ -83,4 +84,4 @@ topics,topics,
type,type,
type_crossref,NA,
updated_date,NA,
versions,NA,
versions,NA,
5 changes: 4 additions & 1 deletion data-raw/gen-data.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
source("./R/oa_fetch.R")

# concept_abbrev <- tibble::tribble(
# ~id, ~display_name, ~abbreviation,
# "https://openalex.org/C41008148", "Computer science", "Comput Sci",
Expand Down Expand Up @@ -47,7 +49,8 @@ concept_abbrev <- tibble::tribble(
oa2df_coverage <- list()
for (entity in setdiff(oa_entities(), "concepts")) {
oa2df_coverage[[entity]] <- readr::read_csv(
sprintf("data-raw/coverage-%s.csv", entity)
sprintf("data-raw/coverage-%s.csv", entity),
show_col_types = FALSE
)
}

Expand Down
Binary file modified data/concept_abbrev.rda
Binary file not shown.
Binary file modified data/oa2df_coverage.rda
Binary file not shown.
10 changes: 5 additions & 5 deletions man/oa_fetch.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions man/oa_random.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions man/snowball2df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions tests/testthat/test-oa_fetch.R
Original file line number Diff line number Diff line change
Expand Up @@ -416,20 +416,19 @@ test_that("different paging methods yield the same result", {
entity = "works",
title.search = c("bibliometric analysis", "science mapping"),
cited_by_count = ">50",
options = list(select = "id"),
from_publication_date = "2021-01-01",
to_publication_date = "2021-12-31",
options = list(select = "id"),
verbose = TRUE,
pages = c(2, 4:5),
per_page = 10,
verbose = TRUE
per_page = 10
)

expect_equal(
w0[c(11:20, 31:min(50, nrow(w0))), ],
w24
)



})

test_that("pages works", {
Expand Down

0 comments on commit df910d0

Please sign in to comment.