When I run the code
cols_name <- c(10:15)
for(i in 1:ncol(df_churn[,cols_name]))
{
df_churn[,cols_name][,i] <- as.factor(mapvalues + (df_churn[,cols_name][,i], from =c("No internet service"),to=c("No")))
}
I get the error
Error in mapvalues(df_churn[, cols_name][, i], from = c("No internet service"), :
`x` must be an atomic vector.