R: How to make the first occurrence of a number into NaN within a group

I'm currently trying to make the row of the first time a subject selects the blue cue into NaN in R. How do I replace the value of the first occurrence of a value within a group (the subject group) with NaN? I tried to do the following:

replacefirsts<-function(x)
{
  dataless[match(unique(dataless$choice==1),dataless$choice),]==NaN;
}
data=tapply(data$sID,list(data$sID),replacefirsts)

When I do this, it new dataset only has the NaN values and not the rest of the rows.