Subset a corpus by filtering works on year, type, OA status, or custom expressions.
Arguments
- corpus
An
sm_corpusobject.- ...
Filtering expressions passed to
dplyr::filter(), evaluated in the context of theworkstibble.- year_range
Optional two-element integer vector for year filtering.
- types
Optional character vector of document types to keep.
- oa_only
Logical; keep only open access works?
See also
Other filters:
sm_query()
Examples
corpus <- sm_example_corpus()
filtered <- sm_filter_works(corpus, year_range = c(2020, 2024))
nrow(filtered$works)
#> [1] 110