Displaying 1 result from an estimated 1 matches for "tp3055417p3057476".
2010 Nov 23
6
the first. from SAS in R
Is there any similar function in R to the first. in SAS?
What it dose is:
Lets say we have this table:
  a b  c
  1 1  5
  1 0  2
  2 0  2
  2 0 NA
  2 9  2
  3 1  3
and then I want do to do one thing the first time the number 1 appers in a
and something else the secund time 1 appers in a and so on.
so 
something similar to:
if first.a {
 a$d<-1
}else{
 a$d<-0
}
This would give me