小编Oma*_*ser的帖子

如何用R创建时间螺旋图

有没有办法在R中绘制这样的图形并且在它上面有相同的12个轴?

这是图表的图片. 照片为图表

这是我的一个数据

        Date1  Time TravelTime
1  2016-09-04 13:11         34
2  2016-09-04 13:12         34
3  2016-09-04 13:13         33
4  2016-09-04 13:14         33
5  2016-09-04 13:15         33
6  2016-09-04 13:16         43
7  2016-09-04 13:17         44
8  2016-09-04 13:18         44
9  2016-09-04 13:19         40
10 2016-09-04 13:20         39
Run Code Online (Sandbox Code Playgroud)

这是dput的输出

structure(list(Date1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L), .Label = "2016-09-04", class = "factor"), Time = structure(1:10, .Label = c("13:11", 
"13:12", "13:13", "13:14", "13:15", "13:16", "13:17", "13:18", 
"13:19", "13:20"), …
Run Code Online (Sandbox Code Playgroud)

datetime r ggplot2 lattice

12
推荐指数
1
解决办法
1677
查看次数

使用R突出显示Sankey图中从头到尾的所有连接路径

当我点击节点以了解特定节点的整个故事时,我想强调整个路径,这里是一个例子 - http://bl.ocks.org/git-ashish/8959771.

请检查此链接,你会发现在javscript中突出显示路径的功能,但请注意,此功能不能达到我想要的效果,它突出显示与被点击的节点相关的链接以及与目标节点相关的链接.我想要的是突出显示与点击的节点相关的所有链接.

d3 Sankey - 从开始到结束突出显示所有连接的路径

这是我需要的一个例子, 在此输入图像描述 这是整个图,我需要的是,当我点击曼谷时,它突出显示与数据框中曼谷相同的所有节点,如突出显示与ClimateChange和EnergyShortage的链接,......然后突出显示基础设施和生态系统,和领导力和战略,......这就是我想要的.这是另一张图片,显示与曼谷相关的节点使用闪亮来分析它.

在此输入图像描述

这是当我在bl.ocks和链接的问题中使用highlight_node_links时会发生什么,这是错误的,并没有显示节点和曼谷之间的关系. 在此输入图像描述

以下是曼谷的数据,向您展示列如何相互关联,当您使用这些数据时,它将仅生成第二张图片.

structure(list(City = c("Bangkok", "Bangkok", "Bangkok", "Bangkok", 
"Bangkok", "Bangkok", "Bangkok", "Bangkok", "Bangkok", "Bangkok", 
"Bangkok", "Bangkok", "Bangkok", "Bangkok", "Bangkok", "Bangkok"
), ResiliencyChallenge = c("ClimateChange", "ClimateChange", 
"ClimateChange", "ClimateChange", "ClimateChange", "InfrastructureFaliure", 
"EnergyShortage", "Pollution", "Pollution", "Pollution", "TransportationSystemFailure", 
"TransportationSystemFailure", "TransportationSystemFailure", 
"TransportationSystemFailure", "TransportationSystemFailure", 
"TransportationSystemFailure"), CRI.Dimesnsion.1 = c("Infrastructure & Ecosystems", 
"Infrastructure & Ecosystems", "Infrastructure & Ecosystems", 
"Infrastructure & Ecosystems", "Infrastructure & Ecosystems", 
"Infrastructure & Ecosystems", "Infrastructure & Ecosystems", 
"Leadership & Strategy", "Leadership & Strategy", "Infrastructure …
Run Code Online (Sandbox Code Playgroud)

r rcharts sankey-diagram networkd3 htmlwidgets

12
推荐指数
1
解决办法
1774
查看次数