I have a data frame containing (in random places) a character value (say "foo"
) that I want to replace with a NA
.
What's the best way to do so across the whole data frame?
This:
df[ df == "foo" ] <- NA
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With