Learn R Programming

goldfish (version 1.6.10)

update-method: Methods to update a nodes or network object

Description

Methods to create a data frame from an object of class nodes.goldfish (see defineNodes()) or a matrix from an object of class network.goldfish (see defineNetwork()) with the attributes or the network ties updated according with the events linked to the object using the linkEvents()) function.

Usage

# S3 method for nodes.goldfish
as.data.frame(x, ..., time = -Inf, startTime = -Inf, envir = new.env())

# S3 method for network.goldfish as.matrix(x, ..., time = -Inf, startTime = -Inf)

Value

The respective object updated accordingly to the events link to it. For nodes.goldfish object the attributes are updated according to the events linked to them. For network.goldfish object the network ties are updated according to the events linked to it.

Arguments

x

an object of class nodes.goldfish for as.data.frame() method or network.goldfish for as.matrix() method.

...

Not further arguments are required.

time

a numeric value or a calendar date value (see as.Date()) to update the state of the object x until this time value (event time < time).

startTime

a numeric as.Date format value; prior events are disregarded.

envir

an environment where the nodes and linked events objects are available.

See Also

defineNetwork(), defineNodes(), linkEvents()

Examples

Run this code
# \donttest{
data("Fisheries_Treaties_6070")
states <- defineNodes(states)
states <- linkEvents(states, sovchanges, attribute = "present")
states <- linkEvents(states, regchanges, attribute = "regime")
states <- linkEvents(states, gdpchanges, attribute = "gdp")

bilatnet <- defineNetwork(bilatnet, nodes = states, directed = FALSE)
bilatnet <- linkEvents(bilatnet, bilatchanges, nodes = states)

updateStates <- as.data.frame(
  states,
  time = as.numeric(as.POSIXct("1965-12-31"))
)


updateNet <- as.matrix(bilatnet, time = as.numeric(as.POSIXct("1965-12-31")))
# }

Run the code above in your browser using DataLab