mapIncidence: Plot incidence time series using histograms

Description Usage Arguments Author(s) Examples

View source: R/mapIncidence.R

Description

This function provides advanced plotting facilities for incidence time series using ggplot2

Usage

1
2
3
4
5
6
mapIncidence(x, dates, lon, lat, fill.by = NULL, col.pal = 0, alpha = 0.5,
  bin = 7, jitter = 0.01, source = "google", zoom = NULL,
  start.at = NULL, stop.at = NULL, xlab = NULL, ylab = "Incidence",
  date.format = "%d %b %Y", angle = 90, xbreaks = "1 week",
  heights = c(0.75, 0.25), ani.width = 800, ani.height = ani.width,
  point.size = 5, annot.size = 20, xy.annot = FALSE, path = tempdir())

Arguments

x

a data.frame containing the data to be plotted.

dates

a character string or an integer indicating which column contains the dates to use

lon

a character string or an integer indicating which column contains longitudes ('x axis')

lat

a character string or an integer indicating which column contains latitudes ('y axis')

fill.by

a character string or an integer indicating which column to use to color the bars

col.pal

an integer between 1 and 8 indicating a color palette to be used; if 0 or NULL, the default color palette of ggplot2 is used

alpha

a numeric value between 0 and 1 handling transparency, with 0 being fulling transparent and 1 having no transparency

bin

an integer indicating the size of the time window (in days) to use for the incidence computation

jitter

a numeric value indicating the amount of random noise added to the locations of new cases

source

a character string indicating the type of maps to be used

zoom

an integer indicating the level of zoom to be used for the map, from 3 (continent) to 21 (building); see get_map

start.at

a starting date for the incidence; defaults to the earliest date of the dataset

stop.at

a stoping date for the incidence; defaults to the latest date of the dataset

xlab

a label for the x axis

ylab

a label for the y axis

date.format

a character string indicating the format of the dates

angle

an integer indicating the angle of the dates

xbreaks

a character string indicating the time interval between vertical lines

heights

a vector of two numbers summing to 1 indicating the relative heights of the map and the incidence time series

ani.width

an integer indicating the width of the image, in pixels

ani.height

an integer indicating the height of the image, in pixels; no-square images are not guaranteed to work

point.size

an integer indicating the size of point to be used for incidence

annot.size

an integer indicating the size of the text annotations

xy.annot

a logical indicating whether latitudes and longitudes should be shown

path

a character string indicating the path used to save the created files

Author(s)

Thibaut Jombart thibautjombart@gmail.com

Examples

1
2
3
4
5
6
7
8
9
## Not run: 

data(zombie_outbreak)
mapIncidence(head(zombie_outbreak,20000), 3,
            "x.coord","y.coord", fill.by="gender",
            jitter=0, zoom=15)


## End(Not run)

Hackout2/incidence documentation built on May 6, 2019, 9:47 p.m.