Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upscale_fill* doesn't see NaN as NA #1482
Comments
|
This is definitely a bug |
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up|
This is definitely a bug |
Had some weirdness in my plots and eventually tracked it down. the
<na.value>parameter in the various scale_fill* scales doesn't recognize<NaN>and instead fills them white.Example:
I don't think this is the desired behavior.
It's also difficult to debug why this is happening because many R functions will put
<NaN>where a user might expect<NA>. For example<mean(c(NA, NA), na.rm = TRUE)>returns<NaN>. I ran into this when doing some ddply on a large dataset. The problem was difficult to isolate because<all.equal()>can't always tell<NA>from<NaN>:returns
<TRUE>.Also, while the View() function in Rgui will show
<NaN>the View function in R-Studio will replace it with<NA>. The<write.csv()>function will also convert<NaN>to<NA>.