l_ccmaps: Conditioned Choropleth Maps (Conditioned Micromaps) in loon

Description Usage Arguments Value Examples

Description

2-way panel of maps for visualizing multivariate data

Usage

1
2
3
4
5
6
7
l_ccmaps(tt = tktoplevel(), cc_inspector = TRUE, title = "CCmaps", spdf,
  respvar, respvar.lab = NULL, cond1var, cond1var.lab = NULL, cond2var,
  cond2var.lab = NULL, respbreaks = 2, cond1breaks = 2, cond2breaks = 2,
  respscale = c("actual", "percent", "log"), cond1scale = c("actual",
  "percent", "log"), cond2scale = c("actual", "percent", "log"), size = 10,
  seg1col = "blue", seg2col = "darkgrey", seg3col = "red",
  optimize = FALSE, otry = 20)

Arguments

tt

Tk top level window. Defaults to a new window

cc_inspector

Whether to draw the custom inspector for CCmaps, which allows for variable selection, variable label update, font size adjustment and option to optimize R^2. Defaults to TRUE. Once created, the inspector can only be closed when the main display window is closed

title

Title of the map. Appears in the title bar of the toplevel window. Defaults to "CCmaps"

spdf

SpatialPolygonsDataFrame object to hold polygon coordinates and attributes. It should contain all variables used in analysis

respvar

Name of the response value variable

respvar.lab

Label for response value variable for slider. Defaults to NULL, in which case respvar is used

cond1var

Name of the first conditioning variable (controls panel assignment in the vertical direction)

cond1var.lab

Label for first conditional variable for slider. Defaults to NULL, in which case cond1 is used

cond2var

Name of the second conditioning variable (controls panel assignment in the horizontal direction)

cond2var.lab

Label for second conditional variable for slider. Defaults to NULL, in which case cond2 is used

respbreaks

Determines how the response data is divided into three groups for coloring scheme. It can either be the integer 2 or a numeric vector of two middle break points. Defaults to 2, in which case the response values are divided into tertiles

cond1breaks

Similar to respbreaks; determines how the first conditioning variable values are divided into three groups for panel membership

cond2breaks

Similar to respbreaks; determines how the second conditioning variable values are divided into three groups for panel membership

respscale

What scale to use for drawing the response variable slider. Must be one of three values - actual (unchanged), percent (quantiles) and log

cond1scale

What scale to use for drawing the first conditioning variable slider. Must be one of three values - actual (unchanged), percent (quantiles) and log

cond2scale

What scale to use for drawing the second conditioning variable slider. Must be one of three values - actual (unchanged), percent (quantiles) and log

size

Font size for model value labels andR^2. Defaults to size 10

seg1col

Color of first interval of points by respvar value. Cannot be 'cornsilk'. Defaults to 'blue'

seg2col

Color of second interval of points by respvar value. Cannot be 'cornsilk'. Defaults to 'darkgrey'

seg3col

Color of third interval of points by respvar value. Cannot be 'cornsilk'. Defaults to 'red'

optimize

Logical value indicating whether panel assignment should be optimized for R^2. Requires a long time to compute. Defaults to FALSE

otry

Integer (greater than 0) indicating number of values to try for optimization (see above). Required if optimize = TRUE. Defaults to 20. A higher otry value leads to more precise estimates at the cost of longer computation time

Value

An object of classes loon_ccmaps and loon, containing the Tk toplevel window, respvar value, cond1var value, cond2var value, and the handles for the loon map plot objects in list form

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 

## Get data
library(rgdal)
library(maptools)
columbus <- readOGR(system.file("shapes/columbus.shp", package = "maptools")[1], verbose = F)

## Plot
cc <- l_ccmaps(title = "Columbus Residential Burglaries and Vehicle Thefts",
               spdf = columbus,
               respvar = "CRIME", cond1var = "PLUMB", cond2var = "HOVAL",
               respscale = "actual", cond1scale = "actual", cond2scale = "actual",
               optimize = FALSE)


## End(Not run)

x249wang/loon.micromaps documentation built on May 10, 2019, 8:30 a.m.