oa_color: Decide color based on Unpaywall-data

Description Usage Arguments Value

Description

Based on 4 criteria from Unpaywall:

strings are case-insensitive Applied rules are:

  1. if is_oa is NA, 'unknown' is returned

  2. if is_oa is FALSE, 'closed' is returned

  3. if host_type is 'repository', 'green' is returned

  4. if host_type is 'publisher' and 'journal_is_oa' is TRUE, 'pure gold' is returned

  5. if host_type is 'publisher' and 'license' is NA or an empty string, 'bronze' is returned

  6. if host_type is 'publisher' and 'license' is not NA or an empty, 'hyrbid' is returned

  7. if we reach this step is_oa is TRUE, but host_type is unknown. SO we return 'unclear (error)'

Usage

1

Arguments

...,

df Either single vectors, or a data.frame with appropriate columns (or a list with equal-length elements) Should either be named with the names "c('is_oa', 'host_type', 'journal_is_oa','license')", or be of length 4, in this order

Value

A vector of colors (as a factor)


EmilBode/NARCISOAFunc documentation built on May 15, 2019, 1:57 a.m.