Extract Substring of Wiki Math

Share:

Description

Extract logical portions of text formatted with wikimath conventions.

Usage

1
2
3
4
5
6
justUnits(x, ...)
noUnits(x, ...)
lhs(x, ...)
rhs(x, ...)
nospace(x, ...)
tos(x, ...)

Arguments

x

character; typically wikimath

...

ignoreded, or passed to sub for lhs and rhs

Details

justUnits extracts the contents of the first parenthetical inclusion. noUnits drops the first parenthetical inclusion. nospace removes all spaces. tos extracts the first occurrence of x_num, where x is 'theta', 'omega', or 'sigma' (case insensitive) and num is an unsigned decimal (1, 2.1, etc.).

Value

character

Author(s)

Tim Bergsma

References

http://metrumrg.googlecode.com

See Also

  • wikiparse

  • wiki2plotmath

  • wiki2latex

Examples

1
2
3
4
5
6
7
wiki <- "CL/F (L) ~ theta_1 * (WT/70)^theta_2"
justUnits(wiki)
noUnits(wiki)
lhs(wiki)
rhs(wiki)
nospace(noUnits(lhs(wiki)))
tos(wiki)	

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.