Skip to content
Prev 34010 / 398513 Next

if else statements in R

This is untested, so try it first, but my approach would be:

W<- function(w)
{
W[i]<-ifelse(comp[i,1]==1, Wo, (work[i-1,5]work[i-1,13]*/Ef))
}

Best,
Andy Perrin

----------------------------------------------------------------------
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
clists at perrin.socsci.unc.edu * andrew_perrin (at) unc.edu
On Mon, 30 Jun 2003, Michael Rennie wrote: