setParams | R Documentation |
It assigns values to the vector of edge weights in the slot $depParams
of object of class
HRMnetwork
and its subclasses.
setParams(obj, value, ...) ## S3 method for class 'HRMnetwork' setParams(obj, value, ...) ## S3 method for class 'HRMtree' setParams(obj, value, ...)
obj |
An object of class |
value |
A named vector with names corresponding to the names of the edges. The vector represents the edge weights: thetas in case of models on trees and deltas in case of models on block graphs. See Vignette "Introduction" also. If an unnamed vector is passed the first element in the vector is assigned to the first edge, the second element to the second edge and so on. |
... |
additional arguments |
It return an object of the same class as obj
but where the slot $depParams
are set to the
vector in the argument value
.
# model on a block graph with three edge parameters g<- graph(c(1,2,2,3, 3,1), directed=FALSE) g<- set.vertex.attribute(g, "name", V(g), c("a", "b", "c")) # name the nodes obj<- HRMBG(g) obj<- setParams(obj, c(0.2,0.3, 0.1)) obj # model on a tree with two edge parameters g<- graph(c(1,2,2,3), directed=FALSE) g<- set.vertex.attribute(g, "name", V(g), c("a" ,"b" ,"c")) # name the nodes obj<- HRMtree(g) obj<- setParams(obj, c(0.2,0.3)) obj x<- c(0.2, 0.3) names(x)<- names(obj$depParams) obj<- setParams(obj, x) obj
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.