Given a large data frame with a column that has unique values
(ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT)
I want to replace some of the values. For example, every occurrence of 'ONE' should be replaced by '1' and
'FOUR' -> '2SQUARED'
'FIVE' -> '5'
'EIGHT' -> '2CUBED'
Other values should remain as they are.
IF/ELSE will run forever. How to apply a vectorized solution? Is match() the corrct way to go?
mapvalues
inplyr
package – David Arenburg