Skip to contents

Function to plot the output from powerSim

Usage

# S3 method for class 'diffs'
plot(power.object, returndata = FALSE, cellsize = NULL)

Arguments

power.object

power analysis object of class gamMRSea.power

returndata

logical stating whether to return the plotting data

cellsize

vector of length two denoting the size of the gridcells (width, height). If unspecified, geom_raster is used for plotting rather than geom_tile.

Value

Figure showing the mean (middle), lower 2.5% (left) and upper 97.5% (right) of estimated differences between before and after the event. (difference = post - pre)

Author

LAS Scott-Hayward

Examples


# Load two power objects that were created with a 20% sitewide decline
# 50 simulations were run
data(nysted.power.oc)
data(nysted.power.oc.null)

plot.diffs(nysted.power.oc)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:Hmisc':
#> 
#>     src, summarize
#> The following object is masked from 'package:splancs':
#> 
#>     tribble
#> The following object is masked from 'package:MRSea':
#> 
#>     contains
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
#> Error in ggplot(plotdata): could not find function "ggplot"