COMPASS-DOE / TEMPEST

Terrestrial Ecosystem Manipulation to Probe Effects of Storm Treatments
MIT License
7 stars 2 forks source link

Limit-calculating code #80

Closed bpbond closed 2 years ago

bpbond commented 2 years ago

Code to calculate fraction of values outside of specified limits and the associated 'stoplight color' associated with that fraction; NAs can either be treated as errors or ignored.

Example usage for some test data:

test %>%
    group_by(plot) %>%
    summarise(flag_sensors(values, limits = c(3,7)))

produces

   plot fraction_out color 
  <int>        <dbl> <chr> 
1     1          0.5 red   
2     2          0.1 yellow
3     3          0   green 

You can source the new flag_sensors.R file to run examples. Feedback welcome!