plot.smerc_optimal_ubpop: Plot object of class 'smerc_optimal_ubpop'.

View source: R/optimal_ubpop-plot.R

plot.smerc_optimal_ubpopR Documentation

Plot object of class smerc_optimal_ubpop.

Description

Plot results of optimal_ubpop. This is only meant for a visual summary of the results. Users will need to access the elements of the smerc_optimal_ubpop object x if they want to create a custom plot.

Usage

## S3 method for class 'smerc_optimal_ubpop'
plot(x, ..., method = "all")

Arguments

x

An object of class smerc_optimal_ubpop.

...

Not used

method

The method to plot. The default is "all". The other valid options are "elbow" and "gini".

See Also

optimal_ubpop

Examples

data(nydf)
coords <- with(nydf, cbind(longitude, latitude))
ubpop_stats <- optimal_ubpop(
  coords = coords, cases = nydf$cases,
  pop = nydf$pop, nsim = 49,
  ubpop = seq(0.05, 0.5, by = 0.05)
)
## Not run: 
plot(ubpop_stats)

## End(Not run)
plot(ubpop_stats, method = "elbow")
plot(ubpop_stats$ubpop_seq, ubpop_stats$elbow_method$stats)
plot(ubpop_stats, method = "gini")
plot(ubpop_stats$ubpop_seq, ubpop_stats$gini_method$stats)

jpfrench81/smerc documentation built on Jan. 13, 2024, 4:30 a.m.