Menu

Using R Code Stringr Installed Replace Empty Strings E Na Status Column Data Frame Hint Gi Q43821406

Using R code with stringr installed how do Replace all emptystrings (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

Expert Answer


Answer to Using R code with stringr installed how do Replace all empty strings (i.e. “”) with NA in the status column of a data fr…

OR