currency {strex}R Documentation

Get the currencies of numbers within a string.

Description

The currency of a number is defined as the character coming before the number in the string. If nothing comes before (i.e. if the number is the first thing in the string), the currency is the empty string, similarly the currency can be a space, comma or any manner of thing.

Usage

str_get_currencies(string)

str_get_currency(string)

Arguments

string

A string for get_currencies() and a character vector for get_currency().

Details

These functions do not allow for leading decimal points.

Value

Examples

str_get_currencies("35.00 $1.14 abc5 $3.8 77")
str_get_currency(c("ab3 13", "$1"))

[Package strex version 0.1.3 Index]