seanchrismurphy/A-Psychologists-Guide-to-R

Mistake in Exercise 3 key

Closed this issue · 1 comments

At the end of Exercise 3 - Subsetting with Replacement - answers.R I think the very last line is incorrect.

For exercise 7, you ask participants to replace NA with 0.
The answer you have in there is: missing_example[!is.na(missing_example)] <- 0

I believe the correct answer is missing_example[is.na(missing_example)] <- 0

The inclusion of the exclamation point leads to a data set that is only zeros and NA, which is the opposite of what you asked for. I think. I'm new at this.

These materials are excellent, overall. Very glad I found them!

Thanks for catching this - I've corrected the mistake.