I have a simple problem in that I have a very long data frame which reports 0 as a char "nothing" in the data frame column. How would I replace all of these to a numeric 0. A sample data frame is below
| Group | Candy |
|---|---|
| A | 5 |
| B | nothing |
And this is what I want to change it into
| Group | Candy |
|---|---|
| A | 5 |
| B | 0 |
Keeping in mind my actual dataset is 100s of rows long.
My own attempt was to use is.na but apparently it only works for NA and can convert those into zeros with ease but wasn't sure if there's a solution for actual character datatypes.
Thanks