Skip to content
Prev 267328 / 398502 Next

Loops to assign a unique ID to a column

Dear Chandra,

You're on the wrong track. You don't need for loops as you can do this vectorised.

as.numeric(interaction(data$Groups, data$Dates, drop = TRUE))

Best regards,

Thierry