Re: [Rd] [patch] Support many columns in model.matrix

2016-03-02 Thread Martin Maechler
> Karl Millar > on Mon, 29 Feb 2016 10:22:51 -0800 writes: > Thanks. > Couldn't you implement model.matrix(..., sparse = TRUE) with a small > amount of R code similar to MatrixModels::model.Matrix ? yes, and basically call R level Matrix::sparse.model.matrix() [[ or eve

Re: [Rd] [patch] Support many columns in model.matrix

2016-02-29 Thread Karl Millar via R-devel
Thanks. Couldn't you implement model.matrix(..., sparse = TRUE) with a small amount of R code similar to MatrixModels::model.Matrix ? On Mon, Feb 29, 2016 at 10:01 AM, Martin Maechler wrote: >> Karl Millar via R-devel >> on Fri, 26 Feb 2016 15:58:20 -0800 writes: > > > Generati

Re: [Rd] [patch] Support many columns in model.matrix

2016-02-29 Thread Martin Maechler
> Karl Millar via R-devel > on Fri, 26 Feb 2016 15:58:20 -0800 writes: > Generating a model matrix with very large numbers of > columns overflows the stack and/or runs very slowly, due > to the implementation of TrimRepeats(). > This patch modifies it to use Rf_duplic

[Rd] [patch] Support many columns in model.matrix

2016-02-26 Thread Karl Millar via R-devel
Generating a model matrix with very large numbers of columns overflows the stack and/or runs very slowly, due to the implementation of TrimRepeats(). This patch modifies it to use Rf_duplicated() to find the duplicates. This makes the running time linear in the number of columns and eliminates the