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

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

$
0
0

Another important variation on this for Histograms developed in 2019.

The computation was updated and includes something - excuse me for maybe oversimplifying -
like creating bins according to the limit=() specification on your binning axis,
and if this is wider than your data,

  • it creates bars with 0 frequency
  • it creates this same warning for those bars

– a completely different problem than clipping your data but with the same message.

The ggplot developers suggested in github handling this a few different ways,https://github.com/tidyverse/ggplot2/issues/3265
https://github.com/tidyverse/ggplot2/issues/4083

1a. If using limit=() inside an axis declaration, set your limit=() precisely to the range of your bars, even if your axis breaks are wider

or 1b. Add option oob = scales::oob_keep to the offending axis declaration

or 2. If using xlim or ylim, wrap it in coord_cartesian()


Viewing all articles
Browse latest Browse all 8

Trending Articles



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