add_links {evolMap}R Documentation

Add links.

Description

Add links to the interactive map.

Usage

add_links(map, links, color = NULL, start = NULL, end = NULL, period = NULL)

Arguments

map

an object of class evolMap.

links

a link data frame with two first columns as source and target marker names (specified with the name argument in add_markers) and any other column with link attributes. Column names can be passed as parameters to the arguments.

color

name of the column with color variable in the link data frame.

start

name of the column with the start time of a period in the link data frame.

end

name of the column with the end time of a period in the link data frame.

period

name of the column with the period name in the link data frame.

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

# create data
markers <- data.frame(
  lat=c(39,47,53,40,53),
  lon=c(-5, 2,-8,-8,-1),
  name=c("m1","m2","m3","m4","m5")
)

links <- data.frame(
  source=c("m4","m1","m2","m5"),
  target=c("m1","m2","m5","m3"),
  num=1:4
)

# create map
map <- create_map()
map <- add_markers(map, markers, name="name", color="name", markerCluster=FALSE)
map <- add_links(map, links, color="num")


# plot map
plot(map)


[Package evolMap version 1.2.33 Index]