diseaseVIZ: Creates a plot/table of diseaseSIM() results

View source: R/diseaseVIZ.R

diseaseVIZR Documentation

Creates a plot/table of diseaseSIM() results

Description

When type="plot", function plots the movement tracks versus the the straight line track between the origin and destination (unless the destination was unspecified in the call to diseaseSIM(), then straight line track is omitted). When type="gradient", creates a gradient plot showing what regions cause agents to gain/lose energy. Two table options are also available using type="summary_table" or type="strat_table" (table with results stratified by energy gain or loss). Please see Vignette for examples of this output.

Usage

diseaseVIZ(
  data,
  type = "plot",
  title = "diseaseSIM results",
  aspect_ratio = 1,
  label = FALSE,
  xlim = NULL,
  ylim = NULL
)

Arguments

data

Data to be plotted, this object should be the output from diseaseSIM().

type

String from "plot", "gradient", "summary_table", or "strat_table".

title

Title for the plot that is output.

aspect_ratio

Aspect ratio, defaults to 1.

label

Logical, label the origin and specified final destination?

xlim

Optionally specify desired x limits as a numeric vector: c(low,hi)

ylim

Optionally specify desired y limits as a numeric vector: c(low,hi)

Examples

# 1. Define Population/Disease Points and Run diseaseSIM()

pop1 <- as.species(x=-100, y=55,
morphpar1=15, morphpar1mean=16, morphpar1sd=2,morphpar1sign="Pos",
morphpar2=19,morphpar2mean=18,morphpar2sd=1,morphpar2sign="Pos")


x=c(-99.475, -98.700, -102.725,-108.325,-98.700,-94.625,-95.175,
-100.425, -103.675 ,-102.475, -100.925, -100.025, -101.425,
-99.125,  -99.275)
y=c(32.225, 34.700, 34.575, 34.425, 34.700, 34.375, 32.525, 32.175, 31.675, 29.575, 28.225, 
26.275, 26.075, 25.025, 24.825)
disease_points=data.frame(x=x,y=y)

EX1 <- diseaseSIM(replicates=5,days=27,env_rast=ex_raster, 
search_radius=400,
sigma=.1, dest_x=999, dest_y=999, mot_x=.9, mot_y=.9,
modeled_species=pop1, optimum_lo=.6,optimum_hi=.8,init_energy=100, 
direction="S",write_results=FALSE,single_rast=TRUE,mortality = TRUE,
energy_adj=c(30,25,20,5,0,-5,-5,-10,-20,-25,-30),disease_loc=disease_points,
disease_energy_interact = 60, disease_mortality=.5,disease_radius=300)

# 2. Run diseaseVIZ() on your result

diseaseVIZ(EX1,title="Visualizing diseaseSIM results",type="plot", aspect_ratio=5/3,
label=TRUE)

diseaseVIZ(EX1,type="summary_table")

diseaseVIZ(EX1,type="strat_table")

diseaseVIZ(EX1,type="gradient")

bgoch5/abmr documentation built on Sept. 1, 2023, 9:27 a.m.