add_markers {evolMap} | R Documentation |
Add markers.
Description
Add markers to the interactive map.
Usage
add_markers(map, data, latitude = NULL, longitude = NULL, name = NULL,
label = NULL, image = NULL, color = NULL, shape = NULL, text = NULL,
info = NULL, infoFrame = c("right","left"),
start = NULL, end = NULL, period = NULL,
markerCluster = FALSE, roundedIcons = TRUE, jitteredPoints = 0)
Arguments
map |
an object of class |
data |
a marker data frame with the locations and information to show in each marker. Its column names can be passed as parameters to the arguments of the function. |
latitude |
name of the column with the latitude coordinates for each marker (first column by default). |
longitude |
name of the column with the longitude coordinates for each marker (second column by default). |
name |
name of the column with names in the marker data frame. |
label |
name of the column with labels in the marker data frame. |
image |
name of the column with the path to marker image files in the marker data frame. |
color |
name of the column with color variable in the marker data frame. |
shape |
name of the column with shape variable in the marker data frame. |
text |
name of the column with texts in the marker data frame. This information will be shown as a popup. |
info |
name of the column with information to display in a panel in the marker data frame. |
infoFrame |
Panel (right or left) where the information is to be displayed The left panel is only available if a description is provided with |
start |
name of the column with the start time of a period in the marker data frame. |
end |
name of the column with the end time of a period in the marker data frame. |
period |
name of the column with the period name in the marker data frame. |
markerCluster |
enable joining of nearby markers when zooming out. |
roundedIcons |
display markers with rounded borders. |
jitteredPoints |
add an amount of noise to markers to avoid overlapping. |
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
# load data
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")
# plot map
plot(map)