R/sugm.plot.R

Defines functions sugm.plot

Documented in sugm.plot

#-----------------------------------------------------------------------------------#
# Package: flare                                                                    #
# sugm.plot(): graph visualization                                                  #
# Author: Xingguo Li                                                                #
# Email: <xingguo.leo@gmail.com>                                                    #
# Date: Dec 2nd 2013                                                                #
# Version: 1.1.0                                                                    #
#-----------------------------------------------------------------------------------#

sugm.plot <- function(G, epsflag = FALSE, graph.name = "default", cur.num = 1, location=NULL){
  gcinfo(FALSE)
  if(missing(location))	location = getwd()
  setwd(location)
  g = graph.adjacency(as.matrix(G!=0), mode="undirected", diag=FALSE)
  layout.grid = layout.fruchterman.reingold(g)
  
  if(epsflag == TRUE)	postscript(paste(paste(graph.name, cur.num, sep=""), "eps", sep="."), width = 8.0, height = 8.0)             
  par(mfrow = c(1,1))
  plot(g, layout=layout.grid, edge.color='gray50',vertex.color="red", vertex.size=2, vertex.label=NA)
  rm(g,location)	
  gc()
  if(epsflag == TRUE) dev.off()
}

Try the flare package in your browser

Any scripts or data that you put into this service are public.

flare documentation built on May 23, 2022, 9:05 a.m.