add_periods: Add Periods.

View source: R/create_map.R

add_periodsR Documentation

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, duration = NULL, periodrep = TRUE)

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.

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.

Value

Object of class evolMap.

Author(s)

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

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)


# plot map
plot(map)


evolMap documentation built on March 31, 2023, 9:30 p.m.