mx_caps: Search term wrapper that allows for different capitalisation...

View source: R/mx_syntax.R

mx_capsR Documentation

Search term wrapper that allows for different capitalisation of term

Description

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.

Usage

mx_caps(x)

Arguments

x

Search term to be formatted

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



query <- c("coronavirus", mx_caps("ncov"))

mx_search(mx_snapshot("6c4056d2cccd6031d92ee4269b1785c6ec4d555b"), query)



mcguinlu/medrxivr documentation built on Sept. 11, 2022, 9:25 p.m.