NEON-biodiversity / Ostats

O-statistics (community pairwise niche overlap statistics)

Home Page:https://neon-biodiversity.github.io/Ostats/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get rid of workaround requiring suppressWarnings in Ostats_plot unit tests

qdread opened this issue · comments

currently, all discrete plots throw a warning when setting x axis limits:

Warning messages:
1: Removed 2 rows containing missing values. 

This is unavoidable ggplot2 behavior. It might be possible to get rid of the warnings by using coord_cartesian to set the x axis limits instead of scale_x_continuous. I tried this but it changed the appearance of other plots in an undesirable way.

Because of this, I simply used suppressWarnings() in the unit tests for Ostats_plot() to prevent devtools::test() from returning warnings that CRAN would treat as errors. This is an undesirable workaround. So the task here is to change the plot function to get rid of the warnings, without undesirably changing the appearance of other plots.

Original discussion of this is in issue #50 but I created this new issue about it to highlight the problem.