Description Usage Arguments Details Value Examples
Clean a character vector (text string) by replacing punctuation and whitespaces with underscores.
1 | clean_text(x, lower = F, ...)
|
x |
character vector |
lower |
logical, convert all characters to lowercase? |
... |
further arguments passed to other methods |
Useful to clean a vector of species names, perhaps obtained from a biodiversity database, to a machine-readable form.
Cleaned-up character vector of the same length and with the same
attributes as x
.
1 2 3 4 5 6 7 8 | # sloppy
x <- c('Alnus___incana', 'Alnus incana ssp.tenuifolia',
'Alnus rubra ', ' Alnus viridis',
'Alnus viridis ssp. crispa', 'Alnus viridis ssp.. sinuata')
# cleaned
clean_text(x)
clean_text(x, lower=TRUE)
clean_text('Alnus viridis ssp.. sinuata ')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.