[R] memory limit problem

2009-09-10 Thread oleg portnoy
Hi,
I have Win XP 32, 4 gig DDR2 and R 2.9.2.
I have memory limit problems.
> memory.limit(4090)
[1] 4090

> memory.limit()
[1] 4090
> a<-trans.matrix.f(7)  # made big matrix of integer 16384*16384
Error: cannot allocate vector of size 512.0 Mb
I not have other objects in R memory.
what I do?
trans.matrix.f <- function(x){
 tr.mat <- matrix(c(0,1,1,0),2)
 for(i in 2:(2*x))
  tr.mat <- rbind(cbind(tr.mat ,tr.mat+1),
  cbind(tr.mat+1,tr.mat ))
 return(tr.mat)
}

Thanks!
Oleg.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R programming question

2015-09-03 Thread Oleg Portnoy
I have two vectors of probability distribution of the same length n for
random variable X and Y. I want to built matrix of two-dimension
distribution for X and Y with assumption of independence.
P(X=i,Y=j)=P(X=i)*P(Y=j)
I want to do this very fast for n=120 and big amount of different
distribution of X and Y.
Thanks.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.