user3868641
user3868641

Reputation: 162

Add title in chorddiag graph - R

I need to add a title in the generated html but I don't know to do it. I have look the documentation but it doesn't appear anywhere that option.

library(chorddiag)
temp = read.csv("chord_data_pj.csv", sep=",", header=FALSE)
temp1 <- as.matrix(temp) 

m <- matrix(c(temp1),nrow = 27, ncol = 27)

paises <- c("AT","BE","BG","BY","CH","CZ","DE","DK","ES","FI","FR","GB","GR","HR","HU","IE","IT","NL","NO","PL","PT","RO","RS","SE","SK","TR","UA")

dimnames(m) <- list(Origen = paises, Destino = paises)

groupColors <- c('#383838','#ffcc00','#124d81','#59b300','#ff4d4d')

chorddiag(m, groupColors = groupColors, groupnamePadding = 40)

Thanks!

Upvotes: 0

Views: 1866

Answers (1)

Antonio Garc&#237;a
Antonio Garc&#237;a

Reputation: 11

Today in version 3.3.1 the packete "chorddiag" seems to change (from a few months at least) to "circlize" (like the doc that you show). The chordDiagram function could be the update of "chorddiag" and to add a title you can use the function "title" of the "graphics" package.

library(circlize)
chordDiagram(g,  annotationTrack = c("name", "grid"),
annotationTrackHeight = c(0.03, 0.01))
title(main = "title")

Upvotes: 1

Related Questions