Skip to content

Error handling for NA in filter in cr_work #253

@LukasWallrich

Description

@LukasWallrich

When there is a missing value in the filter, the error message is very unclear and can thus hard to track down ... especially when using filter with a vector of dois (#249). Can/should that throw an explicit error?

library(rcrossref)
cr_works(filter = c("doi" = cr_r(1), c("doi" = NA)))
#> Error in if (is.logical(z) || tolower(z) == "true" || tolower(z) == "false") {: missing value where TRUE/FALSE needed

Created on 2025-10-08 with reprex v2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions