I have been trying to do some data wrangling (specifically mutating and recoding) with two different datasets and I keep getting this response about replacement has X rows, data has X. I cannot for the life of me figure out why this is.
"Error in $<-.data.frame
(*tmp*
, "call_text", value = c("... %>% tidyr::drop_na(regtype, happy)", : replacement has 5 rows, data has 4"
OR
"Error in mutate()
: ! Problem while computing ..1 = recode(importance, very = 4, somewhat = 3, notvery = 2, not = 1)
. Caused by error in recode()
: ! unused arguments (very = 4, somewhat = 3, notvery = 2, not = 1) Backtrace: 1. ces_new %>% ... 3. dplyr:::mutate.data.frame(., recode(importance, very = 4, somewhat = 3, notvery = 2, not = 1)) 4. dplyr:::mutate_cols(.data, dplyr_quosures(...), caller_env = caller_env()) 6. mask$eval_all_mutate(quo)
Error in mutate(., recode(importance, very = 4, somewhat = 3, notvery = 2, : Caused by error in recode()
: ! unused arguments (very = 4, somewhat = 3, notvery = 2, not = 1)"
Has anyone experienced this before? Is it to do with the class of the variable (they are factors)?