[R] Size limitations for model.matrix?

Erik Iverson eriki at ccbr.umn.edu
Wed Apr 28 19:11:16 CEST 2010



gerald.jean at dgag.ca wrote:
> Hello,
> 
> I am running:
> 
> R version 2.10.0 (2009-10-26)
> Copyright (C) 2009 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
> 
> on a RedHat Linux box with 48Gb of memory.
> 
> I am trying to create a model.matrix for a big model on a moderately large
> data set.  It seems there is a size limitation to this model.matrix.
> 
>> dim(coll.train)
> [1] 677236    128
>> coll.1st.model.mat <- model.matrix(coll.1st.formula, data = coll.train)
>> dim(coll.1st.model.mat)
> [1] 581618    169

Missing data?

nrow(df <- data.frame(a = 1:10 , b = c(2:10, NA)))
[1] 10

nrow(model.matrix(a ~ b, data = df))
[1] 9



More information about the R-help mailing list