I have a variable with numeric integers -6 to 3450. I want to replace anything <0 with its absolute value and 00 in front.
So for example
-6, -5, -4, -3, -2, -1, 0
Become
006, 005, 004, 003, 002, 001, 000
And all the other integers stay the same.
I think there must be a way to do this with ‘replace’.. my best guess..
data <- replace(data$var1, data$var1 < 1, ‘00 + abs()’)