1

I want to recode many unique numeric values (>3000) of one column into new values. The unique values appears many times in the column! I am using R and all available functions like recode need the definition of all new values! Is there a way to define the new values as a range?

values: 131181420120103, 131181420120307, 4330108120070420, 5330068820110810 ...

possible new values:1, 2, 3, 4, ...

1 Answers1

0

We can use match on the column

data$col1 <- match(data$col1, unique(data$col1))
akrun
  • 874,273
  • 37
  • 540
  • 662