I have a dataset with 40 columns and 9000 rows, all of the columns contain at least one string "NA". I want to drop every row that has at least one "NA" but I need to change it to an actual NA value beforehand.
I cannot use the na.strings=""
argument as I am getting my data using the opendatatoronto
package, not read.csv
.
I have also tried this code, which didn't work either. for(i in names(data)) (set(data, which(data[[i]] == "NA"), i, NA))