You can also use the RnavGraph package to visualize high dimensional data (digits in this case) using graphs as a navigational infrastructure. For more information, please refer to http://www.icesi.edu.co/CRAN/web/packages/RnavGraph/vignettes/RnavGraph.pdf.
Here is a description of how you can use RnavGraph to visualize high dimensional data in a graph:
- First, install and load the RnavGraph and graph packages:
> install.packages("RnavGraph") > source("http://bioconductor.org/biocLite.R") > biocLite("graph") > library(RnavGraph)
- You can then create an NG_data object from the digit data:
> digit.group = rep(c(1:9,0), each = 1100) > digit.ng_data = ng_data(name = "ISO_digits", + data = data.frame(digit.isomap$points), + shortnames = paste('i',1:6, sep = ''), + group = digit.group[digit.idx], + labels = as.character(digits.group[digit.idx]))
- Create an NG_graph object from NG_data:
> V = shortnames(digit.ng_data) > G = completegraph(V) > LG =linegraph(G) > LGnot = complement(LG) > ng.LG = ng_graph(name = "3D Transition", graph = LG) > ng.LGnot = ng_graph(name = "4D Transition", graph = LGnot)
- Finally, you can visualize the graph in the tk2d plot:
> ng.i.digits = ng_image_array_gray('USPS Handwritten Digits', + digit.select,16,16,invert = TRUE, + img_in_row = FALSE) > vizDigits1 = ng_2d(data = digit.ng_data, graph = ng.LG, images
= ng.i.digits) > vizDigits2 = ng_2d(data = digit.ng_data, graph = ng.LGnot, images
= ng.i.digits) > nav = navGraph(data = digit.ng_data, graph
= list(ng.LG, ng.LGnot), viz = list(vizDigits1, vizDigits2))
A 3D transition graph plot
- One can also view a 4D transition graph plot:
A 4D transition graph plot