I\'d like to learn how to conditionally replace values in R data frame using if/then statements. Suppose I have a data frame like this one:
df <- data.fra
You are using == instead of =(Assignment Operator) in if block. And I dont think there's need of else block in your example as you are not going to change values
if(df$customer %in% c('paramount','pixar')){ df$customer_id = 99 }
Above code will do the job for you