Hi again,
I found what I was doing wrong.
If you run:> k <- rep(0,1000000)
> tmp <- length (k)
'tmp' now is an object of class 'integer'. I resolve the issue
doing> tmp <- as.numeric(length(k))
then the function> tmp2 <- as.matrix.csr(0,tmp,tmp)
works properly
Thanks,
Jose
On Fri, Aug 14, 2009 at 12:24 PM, Ze grisi <zegrisi@gmail.com> wrote:
> Hi there,
>
> I'm having a problem when trying to create a large matrix (1,000,000 x
> 1,000,000) of the .csr type (package 'SparseM').
> > k <- rep(0,1000000)
> > tmp <- length(k)
> > tmp2 <- as.matrix.csr(0,tmp,tmp)
> Error in if (length(x) == nrow * ncol) x <- matrix(x, nrow, ncol) else {
:
> missing value where TRUE/FALSE needed
> Warning message:
> In nrow * ncol : NAs produced by integer overflow
>
> Curiously, if I run these other commands, it works fine.
> > tmp <- 1000000
> > tmp2 <- as.matrix.csr(0,tmp,tmp)
>
> Please, what am I doing wrong?
>
> Thanks in advance.
> Jose
>
[[alternative HTML version deleted]]