I'm new to R and I'm using a data set from kaggle on bombing operations in WWII
I wanted to replace all the NA's in a column with "UKNOWN" but I get this
Warning message:
In `[<-.factor`(`*tmp*`, is.na(operations[,"theater.of.operations"]), :
invalid factor level, NA generated
This is how I tried to do it
operations[, "theater.of.operations"][is.na(operations[, "theater.of.operations"])] <- "UNKNOWN"
How else should I try to do this?