Guided Project: Creating An Efficient Data Analysis Workflow

Screen Link:

My Code:
complete_reviews <- complete_reviews >
mutate(
state = case_when(
complete_reviews$state == “California” ~ “CA”,
complete_reviews$state == “New York” ~ “NY”,
complete_reviews$state == “Texas” ~ “TX”,
complete_reviews$state == “Florida” ~ “FL”,
TRUE ~ state # ignore cases where it’s already postal code
)
)

What I expected to happen:

What actually happened:

Error: Problem with mutate() input state.
x must be a character vector, not a factor object.
i Input state is case_when(...).
Run rlang::last_error() to see where the error occurred.

Hi @bdevendrakumar1992,

Seems like you have found the solution for it here:

Let us know if you need any additional help. Also, I would recommend you to read this topic:

It will enable you to get help faster.

Best,
Sahil

Hey Jenna
I think that is not the problem , here i just referred the column differently even if i do as you had mentioned was receiving the error , the only way i was able to perform this operation by converting the necessary data type before hand