DynamicGraph          package:dynamicGraph          R Documentation

_D_E_P_R_E_C_A_T_E_D: _S_i_m_p_l_e _i_n_t_e_r_f_a_c_e _t_o _d_y_n_a_m_i_c_G_r_a_p_h

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

     A simple interface to 'dynamicGraph' in the sense that the graph
     should not be given as an object as to 'dynamicGraphMain'. Here
     vertices can be  specified by a vector of text strings with names,
     and/or edges by pairs of the indices of the vertices.

     The function can also be used to add models and views to an
     existing 'dynamicGraph'.

     The interface is deprecated: Use the method 'dg' on an object of
     class 'dg.simple.graph-class' instead, or the methods 'addModel',
     'addView', 'replaceModel', or 'replaceView'.

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

     DynamicGraph(names = character(), types = character(), 
                  from = vector(), to = vector(), edge.list = list(NULL), 
                  labels = names, edge.types = character(), 
                  blocks = list(NULL), block.tree = list(NULL), oriented = NA, 
                  factors = list(NULL), texts = character(), 
                  extra.from = vector(), extra.to = vector(), 
                  extra.edge.list = list(NULL), 
                  object = NULL, viewType = "Simple", 
                  frameModels = NULL, frameViews = NULL, graphWindow = NULL, 
                  addModel = FALSE, addView = FALSE, overwrite = FALSE, 
                  returnNewMaster = FALSE, redraw = FALSE, 
                  control = dg.control(...), ...)

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

   names: See 'vertex.names' of  'dg.simple.graph-class'. 

   types: See 'dg.simple.graph-class'. 

    from: See 'dg.simple.graph-class'. 

      to: See 'dg.simple.graph-class'. 

edge.types: See 'dg.simple.graph-class'. 

edge.list: See 'dg.simple.graph-class'. 

  labels: See 'dg.simple.graph-class'. 

  blocks: See 'dg.simple.graph-class'. 

block.tree: See 'dg.simple.graph-class'. 

oriented: See 'dg.simple.graph-class'. 

 factors: See 'dg.simple.graph-class'. 

   texts: See 'dg.simple.graph-class'. 

extra.from: See 'dg.simple.graph-class'. 

extra.to: See 'dg.simple.graph-class'. 

extra.edge.list: See 'dg.simple.graph-class'. 

viewType: See 'dg.simple.graph-class'. 

  object: The model 'object', or NULL, see 'dg.Model-class'. 

frameModels: An object of class 'DynamicGraph-class'. 'frameModels' is
          the object for a dataset and the models on that dataset. 

frameViews: An object of class 'DynamicGraphModel-class'. 'frameViews'
          is the object for a model and the views of that model. 

graphWindow: An object of class 'DynamicGraphView-class'. 'graphWindow'
          is the object for a view of a model. 

addModel: Logical, if 'addModel' then a model is added to the argument
          'frameModels', and a view of the model is drawn.  If the
          argument 'overwrite' is TRUE and the argument 'graphWindow'
          is given  then the model of 'graphWindow' is replaced by the
          model argument 'object'. If the argument 'overwrite' is TRUE
          and the argument 'frameViews' is given  then the model of
          'frame'\-{Views} is replaced by the model argument 'object'. 

 addView: Logical, if 'addView' then a view of type set by the argument
          'viewType' for the model of the argument 'frameViews' is
          added. 

overwrite: Logical, see the argument 'addModel'.  

  redraw: Logical. If TRUE then the dynamicGraph of the arguments
          'frameModels' is 'redrawn'. New instances of the windows are
          made. 

returnNewMaster: Logical. Alternative implementation of  'addModel',
          using the code of 'redraw'. As 'redraw', but the windows of 
          'frameModels' exists,  and a new model is added. 

 control: Options for 'DynamicGraph' and 'dynamicGraphMain', see
          'dg.control'. 

     ...: Additional arguments to 'dynamicGraphMain'. 

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

     After converting the arguments for the graph first to an object of
     class 'dg.simple.graph-class' then to an object of class
     'dg.graph-class' the function 'dynamicGraphMain' does all the
     work.

     The list of objects can be exported from 'dynamicGraphMain', also
     after modifying the graph.

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

     The returned value from 'dynamicGraphMain'.

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

     Jens Henrik Badsberg

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

     require(tcltk); require(dynamicGraph)

     # Example 1:

     W <- dg(as(new("dg.simple.graph", vertex.names = 1:5), "dg.graph"),
             control = dg.control(title = "Very simple"))

     # Example 2:

     W <- dg(new("dg.simple.graph", from = 1:4, to = c(2:4, 1)), 
             control = dg.control(title = "Simply edges"))

     # Example 3:

     V.Types <- c("Discrete", "Ordinal", "Discrete",
                  "Continuous", "Discrete", "Continuous")

     V.Names  <- c("Sex", "Age", "Eye", "FEV", "Hair", "Shosize")
     V.Labels <- paste(V.Names, 1:6, sep ="/")

     From <- c(1, 2, 3, 4, 5, 6)
     To   <- c(2, 3, 4, 5, 6, 1)

     W <- dg(new("dg.simple.graph", vertex.names = V.Names, types = V.Types,
                 labels = V.Labels, from = From, to = To), 
             control = dg.control(title = "With labels (extraVertices)"))

     # Example 4: Oriented (cyclic) edges, without causal structure:

     W <- dg(new("dg.simple.graph", vertex.names = V.Names, types = V.Types,
                 labels = V.Labels, from = From, to = To, oriented = TRUE),
             control = dg.control(title = "Oriented edges"))

     # Example 5: A factor graph:

     Factors <- list(c(1, 2, 3, 4), c(3, 4, 5), c(4, 5, 6))

     W <- dg(new("dg.simple.graph", vertex.names = V.Names, types = V.Types,
               labels = V.Labels, factors = Factors, viewType = "Factor"),
             control = dg.control(title = "Factorgraph", namesOnEdges = FALSE))

     # Example 6: Edges with more than two vertices:

     EdgeList <- list(c(1, 2, 3, 4), c(3, 4, 5), c(4, 5, 6))

     W <- dg(new("dg.simple.graph", vertex.names = V.Names, types = V.Types,
               labels = V.Labels, edge.list = EdgeList),
             control = dg.control(title = "Multiple edges", namesOnEdges = FALSE))

     W

