r replace blank string with na

# Sample data frame with a column containing blank strings
df <- data.frame(ID = 1:5, Name = c("John", "", "Alice", "", "Bob"), stringsAsFactors = FALSE)

# Replace blank strings with NA in the 'Name' column
df$Name[df$Name == ""] <- NA