NodeVisPos {RNetica} | R Documentation |
When displayed in the GUI, Netica nodes have a position. The
NodeVisPos()
attribute controls where the node will be
displayed.
NodeVisPos(node) NodeVisPos(node) <- value
node |
A |
value |
A numeric vector of length 2 giving the x and y coordinates. |
The visual position of the node doesn't make much different in RNetica, as R does not display the node. However, it will control the appearance when the net is loaded into the Netica GUI.
A numeric vector of length 2 with names "x"
and "y"
.
The minimum possible node position appears to be (0,0) and the maximum is never stated. Netica appears to round positions to the nearest integer. Also, if the position appears too close to the boarder (Netica positions the center of the node), Netica will move it away from the edge.
Russell Almond
http://norsys.com/onLineAPIManual/index.html: GetNodeVisPosition_bn(), SetNodeVisPosition_bn(),
sess <- NeticaSession() startSession(sess) pnet <- CreateNetwork("PositionNet", session=sess) pnode <- NewDiscreteNode(pnet,"PlaceMe") NodeVisPos(pnode) <- c(100,300) pos <- NodeVisPos(pnode) stopifnot( pos["x"] ==100, pos["y"] ==300 ) ## Netica rounds noninteger positions. NodeVisPos(pnode) <- c(74.3,88.8) pos <- NodeVisPos(pnode) stopifnot( pos["x"] ==74, pos["y"] ==88 ) ## Warning, setting a node too close to the edge can cause Netica to ## reposition the node NodeVisPos(pnode) <- c(1,1) pos <- NodeVisPos(pnode) stopifnot( pos["x"] >1, pos["y"] >1 ) DeleteNetwork(pnet) stopSession(sess)