[R] rbind/cbind

Anthony Ching Ho Ng anthony.ch.ng at gmail.com
Wed Aug 10 15:08:24 CEST 2011


Dear list,

I wonder if there a better way to have rbind/cbind/append to create
the first element (if it is empty) instead of doing the following in a
loop?

for (i in 1:10) {
  if (i == 1) {
     aRow = SomeExpression(i)
  } else {
    aRow = rbind(aRow,SomeExpression(i))
  }
}

Thanks

Anthony



More information about the R-help mailing list