I've inherited a script to create a circos/chord diagram in R. I have very basic knowledge of R...
The R studio export options seem to not work except for .png. I need an editable version (.svg or .eps) but the former crashes, and the latter exports without the connections.
I can't figure out how to run the plot code and save it in the command line. I've tried to use the svglite package (see below) and also just svg(filename="Std_SVG.svg")
but it's either not working and not throwing any errors or coming up with failed to load cairo DLL
. Which I can't seem to figure out a way around. Any help please?
svglite(tempfile("chord_test.svg"))
chordDiagramFromMatrix(f, transparency = 0.5, annotationTrack = c('grid'),
symmetric = TRUE, grid.col = node_col,
col = colours, keep.diagonal = TRUE, preAllocateTracks = 1)
circos.trackPlotRegion(track.index = 1, panel.fun = function(x, y) {
xlim = get.cell.meta.data("xlim")
ylim = get.cell.meta.data("ylim")
sector.name = get.cell.meta.data("sector.index")
circos.text(mean(xlim), ylim[1] + .1, sector.name, facing = "clockwise",
niceFacing = TRUE, adj = c(0, 0.5), cex = 1.6)}, bg.border = NA)
circos.clear()
dev.off()