2016-06-10 36 views
0

我需要在生成的html中添加標題,但我不知道要這樣做。我看看documentation,但它沒有出現在任何選項。在chorddiag圖中添加標題 - R

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) 

謝謝!

回答

0

今天在3.3.1版本中,packete「chorddiag」似乎改變了(從至少幾個月)到「circlize」(就像你展示的doc一樣)。 chordDiagram函數可以是「chorddiag」的更新並添加一個標題,您可以使用「圖形」包的函數「標題」。

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