Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dataFrame

Allocates a data frame with given column classes


Description

Allocates a data frame with given column classes.

Usage

## Default S3 method:
dataFrame(colClasses, nrow=1, ...)

Arguments

colClasses

A character vector of column classes, cf. read.table.

nrow

An integer specifying the number of rows of the allocated data frame.

...

Not used.

Value

Returns an NxK data.frame where N equals nrow and K equals length(colClasses).

See Also

Examples

df <- dataFrame(colClasses=c(a="integer", b="double"), nrow=10)
  df[,1] <- sample(1:nrow(df))
  df[,2] <- rnorm(nrow(df))
  print(df)

R.utils

Various Programming Utilities

v2.10.1
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.