The column IL$Uncontested has three values “U” (9 columns), “R-W” (16 columns), and empty or (41 columns). I want to delete the rows in IL for which Uncontested is “R-W”
I found that
IL <- IL[!IL$Uncontested==”R-W”)
deleted both the rows containing “R-W” in IL$Uncontested and the rows that are empty , leaving only the 9 columns containing “U”
I’ve tried various things
IL <- IL[!IL$Uncontested==”R-W”|IL$Uncontested==””]
IL <- IL[!IL$Uncontested==”R-W”|is.na(IL$Uncontested)]
both produce the same error:
Logical subscript !IL$Uncontested == "R-W" | IL$Uncontested == ""
must be size 1 or 21, not 66.
Bert Kritzer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.