converters | R Documentation |
Convert between a numeric vector/matrix and a float vector/matrix.
fl(x, strict = FALSE) dbl(x, strict = FALSE) int(x, strict = FALSE) as.float(x, strict = FALSE) ## S3 method for class 'float32' as.double(x, ...) ## S3 method for class 'float32' as.integer(x, ...) ## S4 method for signature 'float32' as.numeric(x, ...) ## S3 method for class 'float32' as.vector(x, mode = "any") ## S3 method for class 'float32' as.matrix(x, ...) ## S3 method for class 'float32' as.data.frame(x, ...) ## S4 method for signature 'float32' typeof(x) ## S4 method for signature 'float32' storage.mode(x)
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. |
fl()
, int()
, and dbl()
are shorthand for
as.float()
, as.integer()
, and as.double()
, respectively.
The data stored in the type of whatever was asked for (the opposite of the input).
library(float) x = matrix(1:30, 10, 3) s = fl(x) y = dbl(s) all.equal(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.