float {float}R Documentation

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.

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.

Value

A float vector/matrix of 0's.

Examples

library(float)

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


[Package float version 0.3-2 Index]