coexist | R Documentation |
coexist
Interactive network of time coexistences of periods.coexist
produces interactive graphs representing coexistence. Two periods or lifes coexist if they share a given number of years.
coexist(periods, name="name", start="start", end="end",
fields=names(periods), plusstart=0, minusend=0, igraph=FALSE, ...)
periods |
a data frame with at least three vectors with name, start and end of the periods. |
name |
name of the vector with names in the periods data frame. |
start |
name of the vector with starts in the periods data frame. |
end |
name of the vector with ends in the periods data frame. |
fields |
vector of the names of the periods data frame to be taken into account. |
plusstart |
number of years to be trimmed at the beginning of each period. |
minusend |
number of years to be trimmed at the end of each period. |
igraph |
produces an igraph object instead of a netCoin class. |
... |
Any netCoin argument. |
Two periods coexists if they have at least one year in common. Periods can be trimmed at the begining or at the end.
This function creates a netCoin object (or igraph) and, if plotted, a folder in the computer with an HTML document named index.html which contains the produced graph. This file can be directly opened with your browser and sent to a web server to work properly.
A netCoin object has three elements:
nodes |
A data frame with the periods. |
links |
A data frame with the events. |
options |
A list of options for the interactive graph. |
Periods could be the life of people, in whose case start is their birth and end their death year.
Modesto Escobar, Department of Sociology and Communication, University of Salamanca. See https://sociocav.usal.es/blog/modesto-escobar/
timeCoin
and dyncohort
# With sociologists data.
data(sociologists)
# Produce an igraph object:
coexist(sociologists, start="birth", end="death", igraph=TRUE)
# Omit as coexistence the 15 firts years of life:
sociologists$picture <- system.file("extdata", sociologists$picture,
package="netCoin") # copy path to the picture field
coexist(sociologists, start="birth", end="death", plusstart=15, image="picture", imageName="name")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.