Question: Using R code with stringr installed how do Replace all empty strings (i.e. ) with NA in the status column of a data frame. The
Using R code with stringr installed how do Replace all empty strings (i.e. "") with NA in the status column of a data frame.
The hint given is as follows:
> social_df$status[social_df$status == ___] <- ___
My wrong answer is:
> social_df$status[social_df$status == ""] <- str_replace(social_df$status, "", "NA")
However, the following error statements are returned: Error: Empty `pattern` not supported
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
