justUnits: Extract Substring of Wiki Math

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

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)	

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.