as.double2: 'is.double()' for Comma-Decimal Input

View source: R/is.double2.R

is.double2R Documentation

is.double() for Comma-Decimal Input

Description

This works like is.double() and as.double(), but is vectorised and can also check (and transform) comma-decimal input such as "0,1".

Usage

is.double2(x, dec = c(".", ","))

as.double2(x, dec = c(".", ","))

Arguments

x

vector of values

dec

characters to be treated as comma

Examples

is.double(0.1)
is.double("0.1")
is.double("0,1")

is.double2(0.1)
is.double2("0.1")
is.double2("0,1")

is.double(c(0.1, "0.1", "0,1"))
is.double2(c(0.1, "0.1", "0,1"))

as.double(c(0.1, "0.1", "0,1"))
as.double2(c(0.1, "0.1", "0,1"))

certe-medical-epidemiology/certestyle documentation built on July 12, 2024, 2:45 p.m.