Allocates a data frame with given column classes.

# 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)
#>     a            b
#> 1   5  0.280075644
#> 2   8 -0.445817737
#> 3   3  0.003878199
#> 4  10  0.378210279
#> 5   6 -0.800991774
#> 6   7  0.418502532
#> 7   1  0.548471770
#> 8   9 -0.114856253
#> 9   4  2.790667435
#> 10  2  1.257361740