Quantcast
Channel: Explain ggplot2 warning: "Removed k rows containing missing values" - Stack Overflow
Viewing all articles
Browse latest Browse all 8

Answer by Rob for Explain ggplot2 warning: "Removed k rows containing missing values"

$
0
0

I ran into this as well, but in the case where I wanted to avoid the extra error messages while keeping the range provided. An option is also to subset the data prior to setting the range, so that the range can be kept however you like without triggering warnings.

library(ggplot2)range(mtcars$hp)#> [1]  52 335# Setting limits with scale_y_continous (or ylim) and subsetting accordingly## avoid warning messages about removing dataggplot(data= subset(mtcars, hp<=300 & hp >= 100), aes(mpg, hp)) +  geom_point() +  scale_y_continuous(limits=c(100,300))

Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>