0
data=data.frame("student" = c(12,12,12,75,75,75,31,31,31,31,46,46),
"newID"=c(1,1,1,2,2,2,3,3,3,3,4,4))

I have 'data' with 'student' and want to generate 'newID' that keeps the integrity of the 'student' column but starts with 1,2,3, and so on and so forth.

bvowe
  • 3,004
  • 3
  • 16
  • 33

0 Answers0