"edges<-" {rggobi} | R Documentation |
Set edges for a dataset.
"edges<-"(x, value)
x |
ggobiDataset |
value |
matrix or data frame of edges. First column should be from edge, second column to edge. |
To remove edges, set edges to NULL.
@arguments ggobiDataset @arguments matrix or data frame of edges. First column should be from edge, second column to edge. @keyword manip
Hadley Wickham <h.wickham@gmail.com>
cc<-cor(t(swiss),use="p", method="s") ccd<-sqrt(2*(1-cc)) a <- which(lower.tri(ccd), arr.ind=TRUE) src <- row.names(swiss)[a[,2]] dest <- row.names(swiss)[a[,1]] weight <- as.vector(as.dist(ccd)) gg <- ggobi(swiss) gg$cor <- data.frame(weight) edges(gg$cor) <- cbind(src, dest) edges(gg$cor) edges(gg$cor) <- NULL