drawnetwork               package:deal               R Documentation

_G_r_a_p_h_i_c_a_l _i_n_t_e_r_f_a_c_e _f_o_r _e_d_i_t_i_n_g _n_e_t_w_o_r_k_s

_D_e_s_c_r_i_p_t_i_o_n:

     `drawnetwork' allows the user to specify a Bayesian network
     through a point and click interface.

_U_s_a_g_e:

     drawnetwork(nw,df,prior,trylist=vector("list",nw$n),
                 unitscale=20,cexscale=8,
                 arrowlength=.25,nocalc=FALSE,
                 yr=c(0,350),xr=yr,...)

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

_A_r_g_u_m_e_n_t_s:

      nw: an object of class `network' to be edited.

      df: a data frame used for learning the network, see `network'.

   prior: a list containing parameter priors, generated by
          `jointprior'.

 trylist: a list used internally for reusing learning of nodes, see
          `maketrylist'.

cexscale: a numeric passed to `plot.network'. Measures the scaled size
          of text and symbols.

arrowlength: a numeric passed to `plot.network'. Measures the length of
          the edges of the arrowheads.

  nocalc: a logical. If `TRUE', no learning procedure is called, see
          eg. `simulation'.

unitscale: a numeric passed to `plot.network'. Scale parameter for
          chopping off arrow heads.

      xr: a numeric vector with two components containing the range on
          x-axis.

      yr: a numeric vector with two components containing the range on
          y-axis.

     ...: additional plot arguments, passed to `plot.network'.

_D_e_t_a_i_l_s:

     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 ban list
     is stored with the network in the property `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
     data frame.

     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' properties of the nodes by clicking on them. The result
     is shown in the output window.

_V_a_l_u_e:

     A list with two elements, 

      nw: an object of class `network' with the final network.

 trylist: an updated list used internally for reusing learning of
          nodes, see `maketrylist'.

_A_u_t_h_o_r(_s):

     Susanne Gammelgaard Bttcher alma@math.auc.dk, 
     Claus Dethlefsen dethlef@math.auc.dk.

_R_e_f_e_r_e_n_c_e_s:

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

_S_e_e _A_l_s_o:

     `network'

_E_x_a_m_p_l_e_s:

     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

