createNodeVariable {MoNAn} | R Documentation |
createNodeVariable
Description
Assigns a covariate to one nodeset, i.e., an exogenous characteristic of mobile individuals/resources or locations.
Usage
createNodeVariable(
values,
range = NULL,
nodeSet = NULL,
nodes = NULL,
edges = NULL,
addSame = NULL,
addSim = NULL
)
monadicCovar(
values,
range = NULL,
nodeSet = NULL,
nodes = NULL,
edges = NULL,
addSame = NULL,
addSim = NULL
)
Arguments
values |
A vector assigning the covariate value to each element of the nodeset. |
range |
The range of possible values, currently not in use. |
nodeSet |
The nodeset to which the covariate applies. |
nodes |
Alternative way to specify the nodeSet by naming nodes or edges: nodes denote the locations in the edgelist |
edges |
Alternative way to specify the nodeSet by naming nodes or edges: edges denote the individuals in the edgelist |
addSame |
Will the variable be used to model categorical homophily (e.g., with the same_covariate effect)? In this case, addSame needs to be set to TRUE. |
addSim |
Will the variable be used to model continuous homophily (e.g., with the sim_covariate effect)? In this case, addSim needs to be set to TRUE. |
Value
An object of class "nodeVar.monan".
See Also
Examples
# create an object of class nodeVar.monan
region <- createNodeVariable(orgRegion, nodeSet = "organisations")
size <- createNodeVariable(orgSize, nodeSet = "organisations", addSim = TRUE)
sex <- createNodeVariable(indSex, nodeSet = "people")