Learn R Programming

RnavGraph (version 0.1.8)

ng_2d: Visualization instruction for 2d scatterplots on a tk2d display

Description

Visualization instruction for a navGraph session that link the nodes of a navigation graph to 2d scatterplots and the edges to a 3d rigid rotation or a 4d transition.

The scatterplots will be displayed on a tk2d display, provided by the RnavGraph package. tk2d allows the user to display dots, glyphs, text and images at given x-y positions. Further interactivity such as selection, zooming, brushing, changing colors and changing sizes are provided by the tk2d display. tk2d displays can also link data between different navGraph sessions.

Usage

ng_2d(data, graph, images = NULL, glyphs = NULL)

Arguments

data
NG_data object.
graph
NG_graph object.
images
NG_image object. Order of the images must match the order of the data in the NG_data object.
glyphs
Vector of character strings matching either the names or shortnames of the NG_data object.

Value

NG_Viztk2d object that inherits from the NG_Visualization class.

Details

The text labels in the tk2d display are taken from the labels slot in the NG_data object.

It the group slot of the NG_data object contains only colors from the colors function, objects get colored accordingly. Otherwise the group data gets mapped to some color key.

See Also

navGraph, ng_data, ng_graph, ng_image_array_gray, ng_image_files, ng_get-methods, ng_set-methods, ng_2d_myplot

Examples

Run this code
## NG_data
ng.iris <- ng_data(name = "iris", data = iris[,1:4],
		shortnames = c('s.L', 's.W', 'p.L', 'p.W'),
		group = iris$Species,
		labels = substr(iris$Species,1,2))

## NG_graph
G <- completegraph(shortnames(ng.iris))
LG <- linegraph(G, sep = "++")
ng.lg <- ng_graph("3d transition", LG, "++", "fruchtermanReingold" )

## NG_image
## see the image demos: demo(package = "RnavGraph")

## Visualization instruction
viz1 <- ng_2d(ng.iris, ng.lg, glyphs = c("s.L","s.W","p.L","p.W"))
viz1

Run the code above in your browser using DataLab