decomma: Remove commas from numeric fields and return them as numerics

Description Usage Arguments Details Value Author(s) Examples

View source: R/decomma.R

Description

A shortcut function to strip commas out of numeric fields imported from other software and convert them into numeric vectors that can be operated on. This assumes decimal point as opposed to decimal comma notation.

Usage

1

Arguments

x

a character vector containing numbers with commas that should be coerced into being numeric.

Details

This function assumes decimal point notation for numbers. For more information, see http://en.wikipedia.org/wiki/Decimal_mark#Countries_using_Arabic_numerals_with_decimal_point.

Value

A numeric

Author(s)

Jared E. Knowles

Examples

1
2
3
input <- c("10,243", "11,212", "7,011", "5443", "500")
output <- decomma(input)
is.numeric(output)

eeptools documentation built on July 4, 2017, 9:23 a.m.

Search within the eeptools package
Search all R packages, documentation and source code