Hi I have a df as below
a = c("AP_", "AP_", NA, "AP_", "AP_", "HP_", "AP_", "AP_")
b = c(20, 30, 40, 10, 20, 10, NA, 12)
c = c("A", "B", "C", "D", "E", "", "G", "H")
a_output = c("AP_", "AP_", "", "AP_", "AP_", "HP_", "AP_", "AP_")
df = data.frame(a, b, c,a_output)
How to get "a_output" column as a result by converting NA to NULL from "a" column
I have tried with grepl as below
df$a_output = df[is.na(df$a)] <- ""
Any modification in above statement Thanks in advance