ここ
単一の画像は、すべてのバブルで示されています。 [...] を尊敬する従業員バブルに動的に表示することはできますか?パッケージ作者のexample on GitHubに基づいて
は、ここでは、ノードごとに異なる写真付き一つだ://:
library(collapsibleTree)
org <- data.frame(
Manager = c(
NA, "Ana", "Ana", "Bill", "Bill", "Bill", "Claudette", "Claudette", "Danny",
"Fred", "Fred", "Grace", "Larry", "Larry", "Nicholas", "Nicholas"
),
Employee = c(
"Ana", "Bill", "Larry", "Claudette", "Danny", "Erika", "Fred", "Grace",
"Henri", "Ida", "Joaquin", "Kate", "Mindy", "Nicholas", "Odette", "Peter"
),
Title = c(
"President", "VP Operations", "VP Finance", "Director", "Director", "Scientist",
"Manager", "Manager", "Jr Scientist", "Operator", "Operator", "Associate",
"Analyst", "Director", "Accountant", "Accountant"
)
)
# Add in colors and sizes
org$Color <- org$Title
levels(org$Color) <- colorspace::rainbow_hcl(11)
org$tooltip <- sprintf("
%s<br>Title: %s<br><img src='%s'>",
org$Employee,
org$Title,
paste0("https://github.com/twitter/twemoji/blob/gh-pages/72x72/1f19", c(1, 1:9, letters[1:6]), ".png?raw=true")
)
collapsibleTreeNetwork(
org,
attribute = "Title",
fill = "Color",
nodeSize = "leafCount",
tooltipHtml = "tooltip"
)
あいまいさを避けるために、あなたは常に[再現性の例](HTTPSを提供する必要がありますstackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/28481250#28481250)Rタグによって求められたように(代わりに、データのスクリーンショットとのために不完全コード – lukeA