float (version 0.3-2)

converters: converters

Description

Convert between a numeric vector/matrix and a float vector/matrix.

Usage

fl(x, strict = FALSE)

dbl(x, strict = FALSE)

int(x, strict = FALSE)

as.float(x, strict = FALSE)

# S3 method for float32 as.double(x, ...)

# S3 method for float32 as.integer(x, ...)

# S4 method for float32 as.numeric(x, ...)

# S3 method for float32 as.vector(x, mode = "any")

# S3 method for float32 as.matrix(x, ...)

# S3 method for float32 as.data.frame(x, ...)

# S4 method for float32 typeof(x)

# S4 method for float32 storage.mode(x)

Value

The data stored in the type of whatever was asked for (the opposite of the input).

Arguments

x

A numeric or float vector/matrix.

strict

Should the function error if given the wrong kind of input? Otherwise it just silently returns the input.

mode, ...

Ignored.

Details

fl(), int(), and dbl() are shorthand for as.float(), as.integer(), and as.double(), respectively.

Examples

Run this code
library(float)

x = matrix(1:30, 10, 3)
s = fl(x)

y = dbl(s)

all.equal(x, y)

Run the code above in your browser using DataLab