Description Usage Arguments Value Examples
Compute a vector of numeric sample times from labels in a sequence aligment or phylogeny
1 2 | sampleYearsFromLabels(tips, dateFormat = "%Y-%m-%d",
delimiter = NULL, index = NULL, regex = NULL)
|
tips |
A character vector supplying the name of each sample |
dateFormat |
The format of the sample date. See ?Date for more information |
delimiter |
Character(s) which separate data in each label |
index |
Integer position of the date string in each label with respect to *delimiter* |
regex |
A regular expression for finding the date substring. Should not be used with *delimiter* or *index* |
Numeric vector with sample time in decimal format.
1 2 3 4 5 6 7 8 | ## A couple of labels for Ebola virus sequences:
sampleYearsFromLabels( c('EBOV|AA000000|EM104|SierraLeone_EM|2014-06-02'
, 'EBOV|AA000000|G3713|SierraLeone_G|2014-06-09')
, delimiter='|' )
## Equivalently:
sampleYearsFromLabels( c('EBOV|AA000000|EM104|SierraLeone_EM|2014-06-02'
, 'EBOV|AA000000|G3713|SierraLeone_G|2014-06-09')
, regex='[0-9]+-[0-9]+-[0-9]+')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.