powered by
Allocates a data frame with given column classes.
# S3 method for default dataFrame(colClasses, nrow=1, ...)
Returns an NxK data.frame where N equals nrow and K equals length(colClasses).
data.frame
nrow
length(colClasses)
A character vector of column classes, cf. read.table.
character
vector
read.table
An integer specifying the number of rows of the allocated data frame.
integer
Not used.
data.frame.
df <- dataFrame(colClasses=c(a="integer", b="double"), nrow=10) df[,1] <- sample(1:nrow(df)) df[,2] <- rnorm(nrow(df)) print(df)
Run the code above in your browser using DataLab