Re: [R] if then in R versus SAS

2012-08-27 Thread peter dalgaard
r-project.org >> Subject: Re: [R] if then in R versus SAS >> >> >> On Aug 24, 2012, at 1:03 PM, ramoss wrote: >> >>> I am new to R and I have the following SAS statements: >>> >>> if otype='M' and ocond='1' and entry

Re: [R] if then in R versus SAS

2012-08-24 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Marc Schwartz > Sent: Friday, August 24, 2012 12:06 PM > To: ramoss > Cc: r-help@r-project.org > Subject: Re: [R] if then in R versus SAS > > &g

Re: [R] if then in R versus SAS

2012-08-24 Thread Marc Schwartz
On Aug 24, 2012, at 1:03 PM, ramoss wrote: > I am new to R and I have the following SAS statements: > > if otype='M' and ocond='1' and entry='a.Prop' then MOC=1; > else MOC=0; > > How would I translate that into R code? > > Thanks in advance See ?ifelse and ?Logic, both of which are covere

[R] if then in R versus SAS

2012-08-24 Thread ramoss
I am new to R and I have the following SAS statements: if otype='M' and ocond='1' and entry='a.Prop' then MOC=1; else MOC=0; How would I translate that into R code? Thanks in advance -- View this message in context: http://r.789695.n4.nabble.com/if-then-in-R-versus-SAS-tp4641225.html Sent