set.dynamic.edge.attribute {dynamicnetwork}R Documentation

add dynamic attributes to edges

Description

Specifies that the named attribute on the edge in the dynamic network should take on the given value at the givin time and for all later times until the next value

Usage

set.dynamic.edge.attribute(net, attrname, value, valid.time = NULL, e = 1:length(net$mel))

Arguments

net dynamicnetwork the attribute will be attached to
attrname name for the attribute
value value of the attribute
valid.time the time at which the attribute should take on this value
e ids of edges that value should be attached to

Details

This is implemented by adding attributes to edges (on the `mel' list that are [value, time] x num changes matricies. So adding additional values adds more rows to the matrix. (deletion behavior not defined, but should be ok) These attributes are considered `dynamic attributes', defined by having the vertex name listed in the graph-level attribute dyn.edge.attr.names. Uses the interal set.edge.attribute method to set the value. The attribute is assumed to have the same value from valid.time until the next specified time for the named attribute on an edge.

Value

The dynamic network, modified to include the dynamic attribute value

Author(s)

Skye Bender-deMoll skyebend@skyeome.net, CSDE statnet team

See Also

set.dynamic.vertex.attribute,get.slice.network

Examples

#create a dynamic network
   dyn <- as.dynamic(network.initialize(5));
#add an edge from 1 5  from time 1 to time 10 
   dyn <-add.edge.dynamic(dyn,c(1,10),1,5);
#add an attributes named "testing" to edge number 1 at time 1
   dyn <- set.dynamic.edge.attribute(dyn,"testing","1",1,1);
   dyn <- set.dynamic.edge.attribute(dyn,"testing","2",4,1);
   dyn <- set.dynamic.edge.attribute(dyn,"testing","3",6,1);
   
#get the value in the sliced network at time 2
   get.slice.network(dyn,2)
   get.slice.network(dyn,4)

[Package dynamicnetwork version 0.0-4 Index]