I have a titanic xlsx file, which has a lot of blank or empty cells and I saved the file as csv and all the blanks were saved as it is.

When I import the csv file I see a lot of empty strings/blanks in the dataset, one such column is **boat**

I could just go and use readxl package's functions such as read\_xls or read\_xlsx,which would replace the empty strings with NA

But I would like to know if there is a way if I can replace the empty strings after loading into R in the dataframe.

I tried this way but it throws up error, which I don't exactly understand.
I can specify NA in 'NA' in the below code then it would replace with NA but that would be string (NA) not missing value NA, both would be different.

```
titanic %>% mutate(boat = if_else(boat=="", NA ,boat))

Error in mutate_impl(.data, dots) : 
Evaluation error: `false` must be type logical, not character.

```