Re: [R] R code help!

2015-09-21 Thread SH
Hi Jean, Thank you so much! Steve On Sat, Sep 19, 2015 at 1:02 PM, Adams, Jean wrote: > Here's one way to save your results, using a list of lists and a for() > loop. > > nsim <- 100 > outputs <- vector("list", nsim) > for(i in 1:nsim) { > outputs[[i]] <- sim.f(p.s=.05, N=1000, sample.size=6

Re: [R] R code help!

2015-09-19 Thread Adams, Jean
Here's one way to save your results, using a list of lists and a for() loop. nsim <- 100 outputs <- vector("list", nsim) for(i in 1:nsim) { outputs[[i]] <- sim.f(p.s=.05, N=1000, sample.size=69, n.sim=500) } Jean On Fri, Sep 18, 2015 at 2:27 PM, SH wrote: > Dear R users, > > I am trying to s

Re: [R] R code help to change table format

2012-07-10 Thread Rui Barradas
Hello, You should say what is the package you are using, EstimateS returns hundreds of hits. [ package sos, findFn() ]. As for the question, try sp <- 1:5 ab <- c(3, 2, 2, 2, 4) rep(sp, ab) Hope this helps, Rui Barradas Em 10-07-2012 18:23, peziza escreveu: I am trying to input an OTU t

Re: [R] R-code help for filtering with for loop

2009-03-02 Thread David Winsemius
The apply function which can work on either a row-wise of column-wise basis can be used with max and ">" can return a logical vector that will let you separate the rows into those with and without a maximum greater than 60. > datax <- matrix(rnorm(300)*30,nrow=50) > datax <- as.data.frame(

Re: [R] R-code help for filtering with for loop

2009-03-02 Thread ONKELINX, Thierry
Dear John, It looks like you are stuck in both the second and the third circle of the R inferno (http://www.burns-stat.com/pages/Tutor/R_inferno.pdf) You problem is easy to vectorise. #could the number of columns >= 64 in each row NumCols <- rowSums(datax >= 64) #select rows with at least one co