subset.FlowConnect | R Documentation |
It derives subsbset(s) based on flow connection information. For uses see Vignettes "Subsets and Coordinates".
## S3 method for class 'FlowConnect' subset( obj, from, g, U_bar = NULL, vertices = base::setdiff(get.vertex.attribute(g, "name", V(g)), U_bar), matrixForm = FALSE, ... )
obj |
Object of class |
from |
The object from which the subsets should be extracted. For now two input types
are supported: |
g |
|
U_bar |
The set of nodes for which data are missing. Default is NULL. |
vertices |
The vertices for which the set(s) of flow connected nodes are computed. The default is the vertices with observed variables |
matrixForm |
a matrix of ones and zeros: one if the node is in the subset and zero otherwise. |
... |
additional arguments |
Object of the same class as obj
but with non empty slots.
Slot $value
contains a matrix or a list.
If it is a matrix, the number of columns is the same as the number of vertices
in the graph. If it is a list, the list contains for each of the roots an array of the nodes with
which that given root is flow connected.
The slot $root
represents the roots - one for every subset.
rdsobj<- FlowConnect() seg<- graph(c(1,2, 2,3, 2,4, 4,5, 5,6, 5,7), directed = FALSE) name_stat<- c("paris", "2", "meaux", "melun", "5", "nemours", "sens") seg<- set.vertex.attribute(seg, "name", V(seg), name_stat) seg_dir<- graph(c("2","paris", "meaux", "2", "melun", "2","5", "melun","nemours", "5", "sens", "5"), directed = TRUE) fcg<- FlowConnectionGraph(seg_dir) subset(rdsobj, from = fcg, g = seg, U_bar = c("2", "5"), matrixForm = TRUE) subset(rdsobj, from = fcg, g = seg, vertices=c("paris", "meaux", "melun", "nemours", "sens")) subset(rdsobj, from = fcg, g = seg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.