sim_power_dens {geocausal}R Documentation

Simulate power densities

Description

A function that takes the target densities and their priorities and returns a power density image over a range of parameters

Usage

sim_power_dens(
  target_dens,
  dens_manip,
  priorities,
  priorities_manip,
  window,
  color = c("white", "#F8DAC5FF", "#F4825AFF", "#D2204CFF", "#771F59FF"),
  grayscale = FALSE
)

Arguments

target_dens

list of target densities. This should always be a list, even if there is only one target density.

dens_manip

a target density for which we manipulate the value of priorities

priorities

numeric. 'priorities' specifies the priority for the target density that we do not manipulate.

priorities_manip

vector of priorities for the density that we manipulate.

window

owin object

color

the color scale. By default, "white", "#F8DAC5FF", "#F4825AFF", "#D2204CFF", and "#771F59FF".

grayscale

logical. 'grayscale' specifies whether to convert plot to grayscale (by default, FALSE).

Value

list of densities, plot, and priorities

Examples

# Density 1: Distance from Mosul
dist_from_mosul <- get_dist_focus(window = iraq_window,
                                  lon = c(43.158),
                                  lat = c(36.349),
                                  resolution = 0.5,
                                  mile = FALSE,
                                  preprocess = FALSE)

# Density 2: Distance from Baghdad
dist_from_baghd <- get_dist_focus(window = iraq_window,
                                  lon = c(44.366),
                                  lat = c(33.315),
                                  resolution = 0.5,
                                  mile = FALSE,
                                  preprocess = FALSE)

# Simulation
sim_power_dens(target_dens = list(dist_from_baghd),
               dens_manip = dist_from_mosul,
               priorities = 1,
               priorities_manip = c(1, 2, 5, 10, 15, 50),
               window = iraq_window,
               grayscale = FALSE)

[Package geocausal version 0.3.0 Index]