Learn R Programming

evolMap (version 1.3.8)

add_periods: Add Periods.

Description

Add periods to the interactive map.

Usage

add_periods(map, periods, name = NULL, start = NULL, end = NULL,
  latitude = NULL, longitude = NULL, zoom = NULL,
  description = NULL, popup = FALSE, duration = NULL, periodrep = TRUE)

Value

Object of class evolMap.

Arguments

map

an object of class evolMap.

periods

a period data frame defining periods with the following columns: name, start and end.

name

name of the column with names in the period data frame (first column by default).

start

name of the column with the start time of a period in the period data frame (second column by default).

end

name of the column with the end time of a period in the period data frame (third column by default).

latitude

name of the column with the latitude coordinates to center zoom on each period.

longitude

name of the column with the longitude coordinates for center zoom in each period.

zoom

name of the column with the zoom size to display each period.

description

name of the column with the description of each period.

popup

should the description be displayed as a popup?.

duration

name of the column with the period duration in seconds.

periodrep

If false, time will run by year, and the period will only be shown in the header. Otherwise, time will run by period.

Author

Modesto Escobar modesto@usal.es, Department of Sociology and Communication, University of Salamanca, Carlos Prieto cprietos@usal.es, and David Barrios metal@usal.es, Bioinformatics Service, University of Salamanca.

Examples

Run this code
data(sociologists)
data(locations)

# load pictures
sociologists$picture <- system.file("extdata", sociologists$picture,
  package="evolMap")

# join locations
sociologists$latitude <- locations[,1]
sociologists$longitude <- locations[,2]

# create map
map <- create_map()
map <- add_markers(map, sociologists,
  latitude = "latitude", longitude = "longitude",
  label = "label", image = "picture",
  start = "birth", end = "death",
  period = "generation", markerCluster = FALSE)

periods <- data.frame(
name = c("1775-1799","1800-1824","1825-1850","1851-1874"),
start = c(1775,1800,1825,1851),
end = c(1799,1824,1850,1874)
)
map <- add_periods(map, periods)

# \donttest{
# plot map
plot(map)
# }

Run the code above in your browser using DataLab