float (version 0.2-4)

float: float

Description

An analogue to integer() and double() for preallocation.

Usage

float(length = 0, nrow, ncol)

Arguments

length

Input data of type integer.

nrow, ncol

Number of rows/columns if a matrix return is desired. See details section for more information.

Value

A float vector/matrix of 0's.

Details

If both of nrow and ncol are specified, then length is ignored, and the retor is a matrix. If one (but not the other) of nrow or ncol is given, then the function errors. Otherwise, a vector of length length is returned.

Examples

Run this code
# NOT RUN {
library(float)

float(10)
float(nrow=2, ncol=3)

# }

Run the code above in your browser using DataLab