creates a pseudo-random gn object
Creates a gn object which characteristics are randomly generated
following the requirements of the call. Also positions illuminating
the struture are proposed. Normally the produced gn is connected and
without cycles. When the request is not possible, a warning is issued
and some compatible option is provided. Using this function with the
same set.seed starting point (and the same request) must produce
Different types of gn are possible, their characteristics are given by arguments and pseudo-randomness. The type argument describes the structure of the links without care about the directions (as edges). The possible types are:
All nodes are aligned in a simple chain. So a relationship exists between nno and nar: nno = nar +1. Then nno will be drawn and nar deduced.
Like the chain type but a cycle is done with the relationships and nno = nar.
A hierarchy in the sense that the nodes can be disposed in a dendrogram structure; a particular case of this is the "star" structure when there only a branching point and the branches can comprise several nodes.
A hierarchy with two levels. For this specific case, 'nno' is the number of grouping levels and 'nar' is the number of terminal nodes for each grouping levels. Names of nodes are determined accordingly.
Not so simple to describe. Nodes are placed in the cell of square matrix and edges between nodes respects this structure. Arcs (including their number) are deduced from the node positions. Run some cases and you will understand seing the plot.
Four of the nodes are on the vertices of a tetrahedron and the other nodes are on its edges.
The maximum number of arcs, nno*(nno-1)/2, is provided. So nar will not be considered.
It is suggested that the seed be initialized before calling this function.
Either the name or the description (preferably) for the newly created gn.
type of the gn, see the description field for details
range within which must be the number of nodes. Of course
the range can be null, in that case the number of nodes is directly
provided by the user. If not, it is drawn according to a uniform
distribution (one integer from
range within which must be the number of arcs. Similar to
vector of names to be used for the nodes.
indicates the directions of the arcs between the nodes
of a /gn/. There are two possibilities: "nat" for natural directions
and "ran" for random under the restriction of no cycles.
maximum level of hierarchy; only used when
Of course if too much arcs are ordered, the probability of a
non-cycle graph may be very small, even null.
To prevent this, a local nb\_trial limits the number of draws, if this limit is reached then a fatal error is issued.
For some type (e.g. "square"), the ordered number of arcs and nodes may not be respected for some reasons.
1 2 3 4
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.