Re: [R] Conditional expressions in commands -- basic

2014-03-22 Thread Richard Sherman
Sarah, i = 1 while i > 0 { print("Thank you") i = i + 1 } --- Richard Sherman > On Mar 22, 2014, at 8:06 PM, Sarah Goslee wrote: > > Hi Richard, > > ?if > ?ifelse > ?subset > ?[ > > depending on the specific operation. See inline. > > Given a data frame tdf with x, y, and a (or with

Re: [R] Conditional expressions in commands -- basic

2014-03-22 Thread Sarah Goslee
Hi Richard, ?if ?ifelse ?subset ?[ depending on the specific operation. See inline. Given a data frame tdf with x, y, and a (or with vectors creating a data frame using): tdf <- data.frame(x=x, y=y, a=a) On Sat, Mar 22, 2014 at 10:21 PM, Richard Sherman wrote: > Hi all, > > A simple question,

[R] Conditional expressions in commands -- basic

2014-03-22 Thread Richard Sherman
Hi all, A simple question, new-ish to R, coming from Stata, and I yes I've looked at great length and not found ... In Stata I might write (with * in place of #) # regress y on x in the set of observations where a==1 reg y x if a==1 # descriptives on x where a==1 su x if a==1 # generate a lo