Re: [R] Double for loop

2008-06-26 Thread jim holtman
You can at least get rid of the for (i in 1:200){ y[i]<-rbinom(1,1,0.8) x1[i]<-ifelse(y[i]==1,rnorm(1,mean=20, sd=2),rnorm(1,mean=16, sd=2.2)) loop with the following y <- rbinom(200, 1, 0.8) y.1 <- y == 1 # get logical vector of y == 1 x1 <- numeric(200) # allocate the vector x1[y.1] <-

[R] Double for loop

2008-06-26 Thread sigalit mangut-leiba
Hi, I'm trying to do a double for loop like this: for (k in 1:1000){ for (i in 1:200){ y[i]<-rbinom(1,1,0.8) x1[i]<-ifelse(y[i]==1,rnorm(1,mean=20, sd=2),rnorm(1,mean=16, sd=2.2)) } for (j in 1:300){ } } Does anyone know a good reference about double loops? Thank you, Sigalit [[a

Re: [R] expression, strsplit, ...

2008-06-26 Thread baptiste AuguiƩ
On 25 Jun 2008, at 19:45, Gabor Grothendieck wrote: Try this: plot(1, xlab = ~ alpha / V * m^-3 * kg ^-2 * l^4) Thanks, I would never have expected this code to work, this is a mystery to me! Actually, I thought xlab wanted an expression, but it seems to be happy with a formula. Also,

[R] Point size problem

2008-06-26 Thread Marcin Kozak
Hi all, I have a simple question and couldn't find any post on this. When plotting simple scatterplots (other plots as well), e.g., x<-rnorm(30, 10, 1) y<-rnorm(30, 10, 1) plot(x, y, pch = 15, cex = 1), the points, even those close to each other, may have visibly different sizes. Do you know wha

[R] [R-pkgs] Package bigmemory now available on CRAN

2008-06-26 Thread Jay Emerson
Package "bigmemory" is now available on CRAN. A brief abstract follows: Multi-gigabyte data sets challenge and frustrate R users even on well-equipped hardware. C/C++ and Fortran programming can be helpful, but is cumbersome for interactive data analysis and lacks the flexibility and power of R's

<    1   2