
Add links to the interactive map.
add_links(map, links, color = NULL, start = NULL, end = NULL, period = NULL,
curve = TRUE, arrows = FALSE)
Object of class evolMap
.
an object of class evolMap
.
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.
name of the column with color variable in the link data frame.
name of the column with the start time of a period in the link data frame.
name of the column with the end time of a period in the link data frame.
name of the column with the period name in the link data frame.
Links will be displayed as a curve.
Links will show an arrow at the end.
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.
# 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")
# \donttest{
# plot map
plot(map)
# }
Run the code above in your browser using DataLab