# first, delete existing windows to save memory:
deleteAllWindows(CytoscapeConnection())
cy <- CytoscapeConnection ()
cw <- CytoscapeWindow ('demo.existing', graph=makeSimpleGraph ())
displayGraph (cw)
layoutNetwork(cw, 'force-directed')
cw2 <- existing.CytoscapeWindow ('demo.existing', copy.graph.from.cytoscape.to.R=TRUE)
Run the code above in your browser using DataLab