Learn R Programming

geocausal (version 0.3.2)

get_distexp: Get the expectation of treatment events with arbitrary distances

Description

`get_distexp()` takes counterfactual densities and and returns the expected number of treatment events based on distances from a user-specified focus.

Usage

get_distexp(
  cf_sim_results,
  entire_window,
  dist_map,
  dist_map_unit = "km",
  grayscale = FALSE,
  use_raw = FALSE
)

Value

A list of ggplot objects that summarizes how expectations change over distances from a focus (`expectation_plot`) and summarizes distances and areas (`window_plot`). Note that the second object can not necessarily be well drawn depending on how windows are defined.

Arguments

cf_sim_results

output of `sim_cf_dens()`

entire_window

owin object of the entire region

dist_map

im object whose cell values are the distance from a focus (e.g., city)

dist_map_unit

either `"km"` or `"mile"`

grayscale

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

use_raw

logical. `use_raw` specifies whether to use the raw value of expectations or percentiles. By default, `FALSE`.