cism_map_interactive: interactive cism map

Description Usage Arguments Value

View source: R/cism_map_interactive.R

Description

Generate simple interactive maps of variables. Meant to show one of 3 different kinds of maps: 1. A simple point map with no coloring 2. A point map with coloring by a categorical variable 3. A point map with coloring by a numeric variable This function is identical in input to cism_map, in all ways but three: 1. Rather than returning a ggplot2 plot, it returns a leaflet html widget. 2. It takes a spdf (regular SpatialPolygonsDataFrame) rather than a fspdf (fortified one). 3. It takes an optional popup argument.

Usage

1
2
3
cism_map_interactive(lng, lat, x = NULL, popup = NULL, spdf = NULL,
  type = NULL, make_simple = TRUE, n_simple = 10, opacity = 0.5,
  point_size = 1)

Arguments

lng

A numeric vector of longitude coordinates

lat

A numeric vector of latitude coordinates

x

A variable to be plotted. If NULL (the default), the locations only will be plotted

popup

A character vector, of identical lenggth to lat and lng, containing information to be viewed upon clicking

spdf

A spatial polygons dataframe

type

Either "numeric" or "factor". If NULL (the default), this function will try to guess the type of variable. Ignored if both x and y are supplied.

make_simple

Whether to simplify a categorical variable to fewer than n_simplify categories. Ignored unless y is NULL and x is categorical.

n_simple

The number of categories to simplify x to. Ignored unless y is NULL and x is categorical.

Value

A plot


joebrew/cism documentation built on May 19, 2019, 2:58 p.m.