extract_numbers: Extract just the numbers from a string, including decimal...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/BioGeoBEARS_generics_v1.R

Description

This function extracts numbers from a string. Contiguous digits, including decimal points, are made into a single number. A list of numbers is returned.

Usage

1
  extract_numbers(tmpstr)

Arguments

tmpstr

An input string.

Details

This saves you having to remember the regexp/gregexpr code for this sort of thing, and makes it much easier to parse numbers out of the text output of various programs.

Value

x2 The list of numbers

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster

Matzke_2012_IBS

See Also

gregexpr

Examples

1
2
3
4
5
tmpstr = "190Ma - 65Ma"
extract_numbers(tmpstr)

tmpstr = "190.1Ma - 65.5Ma"
extract_numbers(tmpstr)

BioGeoBEARS documentation built on May 29, 2017, 8:36 p.m.