Hi, you can use write.table(), with some parameters set to suppress row and column names:
g <- erdos.renyi.game(4, 1/2) write.table(g[sparse = FALSE], file = "/tmp/adjmat.txt", col.names=FALSE, row.names=FALSE) Use write.csv() for a csv. Gabor On Fri, Sep 26, 2014 at 8:57 AM, Thomas <[email protected]> wrote: > In R, is there an easy way to save an adjacency matrix as a txt or csv file? > > So in txt the file would contain something like: > > 1 0 0 1 > 0 0 1 1 > 0 1 1 0 > 1 1 1 0 > > Thank you, > > Thomas Chesney > This message and any attachment are intended solely for the addressee and > may contain confidential information. If you have received this message in > error, please send it back to me, and immediately delete it. Please do not > use, copy or disclose the information contained in this message or in any > attachment. Any views or opinions expressed by the author of this email do > not necessarily reflect the views of the University of Nottingham. > > This message has been checked for viruses but the contents of an attachment > may still contain software viruses which could damage your computer system, > you are advised to perform your own checks. Email communications with the > University of Nottingham may be monitored as permitted by UK legislation. > > > > > > _______________________________________________ > igraph-help mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/igraph-help _______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
