visnetwork

Creating a horizontal bar chart in R to display sequence of activities

六月ゝ 毕业季﹏ 提交于 2019-12-02 11:09:21
The dataset "patients" is an eventlog of patients visiting a clinic and getting treatment. The script below gives a data frame with traces or sequence of activities in the eventlog, trace_id and absolute frequency of the cases following the particular trace. I wish to create a dynamic horizontal bar chart using ggplot2 or plotly such that the traces are represented like the snapshot attached with the absolute frequency in % at the top of the bar with axes labels. Thanks and please help! library("bupaR") traces(patients, output_traces = T, output_cases = F) Hope this helps (I am not able to get

Using visNetwork to dynamically update nodes in R

六月ゝ 毕业季﹏ 提交于 2019-12-02 09:44:42
the below snapshot visual is created using the "visNetwork" package. My requirement here is that I have to hard code the edges and also after using visHierarchicalLayout(), I am not able to see them in order, Please help me with a dynamic approach such that no matter how many numbers, I get consecutive numbers in order without hard code. Thanks and please help. library(visNetwork) nodes <- data.frame(id = 1:7, label = 1:7) edges <- data.frame(from = c(1,2,3,4,5,6), to = c(2,3,4,5,6,7)) visNetwork(nodes, edges, width = "100%") %>% visEdges(arrows = "to") %>% visHierarchicalLayout() Using level

Creating a dynamic chart displaying sequences of activities with their count in R

那年仲夏 提交于 2019-12-02 09:21:18
If you run the R script below, the dataset "patients" is an eventlog of patients visiting a clinic and getting treatment. The trace explorer gets created as in the snapshot below with the tooltip displayed. Now in the "#Script for Frequency Percentage", you get the frequency percentage for each trace in the column "af_percent". My requirement is that, I just want to replace the "label = value" in the ggplot command below with corresponding frequency percentage of each trace. Please help. library(splitstackshape) library(scales) library(ggplot2) library(plotly) tr <- data.frame(traces(patients,

Integrating the js code in R to make the visNetwork edges curved

随声附和 提交于 2019-11-29 17:59:36
the script below creates the visNetwork as shown in the visualization below. I want a functionality to make the edge "1" and edge "3" curved. I am attaching the js code that can be used to achieve this. However, please help me to integrate the same code in R. Thanks. nodes <- data.frame(id = 1:4) edges <- data.frame(from = c(2,4,3,2), to = c(1,2,4,3), label = 1:4) edges <- data.frame(edges,edges$from) visNetwork(nodes, edges, width = "100%") %>% visEdges(arrows =list(to = list(enabled = TRUE, scaleFactor = 2)), color = list(color = "lightblue", highlight = "red")) %>% visHierarchicalLayout()

Integrating the js code in R to make the visNetwork edges curved

本小妞迷上赌 提交于 2019-11-28 12:41:17
问题 the script below creates the visNetwork as shown in the visualization below. I want a functionality to make the edge "1" and edge "3" curved. I am attaching the js code that can be used to achieve this. However, please help me to integrate the same code in R. Thanks. nodes <- data.frame(id = 1:4) edges <- data.frame(from = c(2,4,3,2), to = c(1,2,4,3), label = 1:4) edges <- data.frame(edges,edges$from) visNetwork(nodes, edges, width = "100%") %>% visEdges(arrows =list(to = list(enabled = TRUE,