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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!