Search term wrapper that allows for different capitalisation of term
Source:R/mx_syntax.R
mx_caps.Rd
Inspired by the varying capitalisation of "NCOV" during the coronavirus pandemic (e.g. ncov, nCoV, NCOV, nCOV), this function allows for all possible configurations of lower- and upper-case letters in your search term.
Value
The input string is return, but with each non-space character repeated in lower- and upper-case, and enclosed in square brackets. For example, mx_caps("ncov") returns "[Nn][Cc][Oo][Vv]"
See also
Other helper:
mx_crosscheck()
,
mx_download()
,
mx_export()
Examples
# \donttest{
query <- c("coronavirus", mx_caps("ncov"))
mx_search(mx_snapshot("6c4056d2cccd6031d92ee4269b1785c6ec4d555b"), query)
#> Using medRxiv snapshot - 2020-08-22 15:42
#> Found 1856 record(s) matching your search.
#> # A tibble: 1,856 × 14
#> ID title abstract authors date category doi version
#> <int> <chr> <chr> <chr> <date> <chr> <chr> <int>
#> 1 88 Higher energy requi… "Backgr… Ebbeli… 2019-07-11 Nutriti… 10.1… 1
#> 2 676 Resilience to domin… "Here w… Lacaze… 2019-10-22 Genetic… 10.1… 1
#> 3 501 Patterns of Autism … "We sim… Lefort… 2019-09-27 Psychia… 10.1… 1
#> 4 1371 Novel coronavirus 2… "Since … Read, … 2020-01-28 Infecti… 10.1… 2
#> 5 1426 Incubation Period a… "The ge… Linton… 2020-02-18 Infecti… 10.1… 2
#> 6 1430 Epidemiological ide… "Object… Jung, … 2020-02-03 Epidemi… 10.1… 2
#> 7 1465 Estimating the effe… "We est… Cao, Z… 2020-01-29 Infecti… 10.1… 1
#> 8 1446 The incubation peri… "Curren… Backer… 2020-01-30 Infecti… 10.1… 2
#> 9 1475 Estimated effective… "Travel… Gostic… 2020-02-03 Epidemi… 10.1… 2
#> 10 1473 Risk for Transporta… "On Jan… Du, Z.… 2020-02-17 Epidemi… 10.1… 4
#> # ℹ 1,846 more rows
#> # ℹ 6 more variables: author_corresponding <chr>,
#> # author_corresponding_institution <chr>, link_page <chr>, link_pdf <chr>,
#> # license <chr>, published <chr>
# }