Learn R Programming

nlist (version 0.1.1)

numericise: Numericise (or Numericize)

Description

Attempts to coerce a non-numeric R object to natomic_object() or list of {natomic_object}. If possible the dimensionality is preserved.

Usage

numericise(x, ...)

numericize(x, ...)

# S3 method for default numericise(x, ...)

# S3 method for logical numericise(x, ...)

# S3 method for integer numericise(x, ...)

# S3 method for double numericise(x, ...)

# S3 method for factor numericise(x, ...)

# S3 method for Date numericise(x, ...)

# S3 method for POSIXct numericise(x, ...)

# S3 method for hms numericise(x, ...)

# S3 method for matrix numericise(x, ...)

# S3 method for array numericise(x, ...)

# S3 method for list numericise(x, ...)

# S3 method for data.frame numericise(x, ...)

Arguments

x

An R object.

...

Unused

Value

The modified object.

Methods (by class)

  • default: Numericise default object

  • logical: Numericise logical vector

  • integer: Numericise integer vector

  • double: Numericise double vector

  • factor: Numericise factor

  • Date: Numericise Date

  • POSIXct: Numericise POSIXct

  • hms: Numericise hms

  • matrix: Numericise matrix

  • array: Numericise array

  • list: Numericise list

  • data.frame: Numericise data.frame

Details

Date, POSIXct and hms objects are floored first.

numericize() is an alias for numericise.

Examples

Run this code
# NOT RUN {
numericize(TRUE)
numericize("1.9")
numericize(factor(c("beta", "alpha")))
numericize(matrix(c(TRUE, FALSE, NA, TRUE), 2))
numericize(as.Date("1970-02-03"))
numericize(as.POSIXct("1970-02-03", tz = "GMT"))
# }

Run the code above in your browser using DataLab