Interesting—calculating the average of
yard_area simply returned
NA. That's not very helpful!
Missing values are tricky and often cause lots of problems in data analysis because you cannot perform standard operations on them. A missing value isn't even a value to begin with! Thus, any operations involving missing values cannot be fully determined.
Relational operators will not work as you might expect with
NA. For example, the condition
NA > 5
will neither return
. Rather, it will return
because R doesn't know how to compare an unknown value (
) with the number 5.
Keep in mind that R will not throw an error or give you a warning in such cases—it will simply return
NA. Thus, it's important to examine your data ahead of time before performing any calculations so you know if you'll be dealing with missing values.