Learn R Programming

deal (version 1.1-1)

drawnetwork: Graphical interface for manipulation of networks

Usage

drawnetwork(nw,df,prior,trylist=rep(list(NULL),nw$n),
            scale=10,unitscale=20,cexscale=8,
            arrowlength=.25,nocalc=FALSE,smalldf=NA,
            yr=c(0,350),xr=yr,...)

inspectprob(nw,scale=10,unitscale=20,cexscale=8,
            arrowlength=.25,xr=c(0,350),yr=xr,...)

Arguments

nw
The initial network, see network.
df
Dataframe used for learning the network, see network.
prior
A joint prior, see jointprior.
trylist
Used internally for reusing learning of nodes, see maketrylist.
cexscale
Passed to plot.network.
arrowlength
Passed to plot.network.
nocalc
Used when no learning is wanted, see eg. simulation.
smalldf
Used for analysing networks with time-varying nodes, see timeslice.
unitscale
Passed to plot.network.
scale
Passed to plot.network.
xr
Range on x-axis.
yr
Range on y-axis.
...
Passed to plot.network.

Value

  • A list with two elements
  • nwA networkfamily with all created networks.
  • trylistUpdated.

Details

To insert an arrow from node 'A' to node 'B' first click node 'A' and then click node 'B'. When the graph is finished, click 'stop'. To specify, that an arrow must not be present, press 'ban' (a toggle) and draw the arrow. This is shown as a red dashed arrow. It is possible to ban both directions between nodes. The banlist is stored with the network in the attribute banlist. It is a matrix with two columns. Each row is the 'from' node index and the 'to' node index, where the indices are the column number in the dataframe. Note that the network score changes as the network is re-learned whenever a change is made. (Unless nocalc is TRUE). inspectprob draws the network and makes it possible to inspect the prob attributes of the nodes by clicking on them. The result is shown in the output window.

References

Further information about Deal can be found at: http://www.math.auc.dk/novo/deal.

See Also

network

Examples

Run this code
data(rats)
rats.nw    <- network(rats)
rats.prior <- jointprior(rats.nw,12)
rats.nw    <- learn(rats.nw,rats,rats.prior)$nw

newrat  <- drawnetwork(rats.nw,rats,rats.prior)$nw

Run the code above in your browser using DataLab