ggplotly

Creating Process Map Diagrams using different packages in R

≯℡__Kan透↙ 提交于 2020-01-02 09:31:37
问题 the given script simply creates a process map diagram showing the flow of events in R. This field of study is called event log mining or process mining. I wish to know any other packages or functionality in R using which I can create similar maps and also make them interactive like ggplotly. Please help me with some links if possible. Thanks and please help. library(bupaR) library(edeaR) library(eventdataR) library(processmapR) library(processmonitR) library(xesreadR) library(petrinetR)

Strange formatting of legend in ggplotly in R

混江龙づ霸主 提交于 2019-12-31 03:46:11
问题 I'm trying to turn a ggplot into a plotly. The ggplot renders fine, but when I put it through ggplotly, suddenly the legend adds parenthesis and ",1" after the label. Here's a sample fake data: sorted1<-data.frame(CommDate=c(as.Date("2017-09-12"), as.Date("2017-10-15")), CommName=c("Foo", "Bar"), PubB4=c(2,3)) And here's the code I'm trying to run on it: ggplotly(ggplot(sorted1, aes(x=as.Date(CommDate), y=PubB4))+ geom_smooth(level=0.0, aes(colour="Moving average"), se=FALSE)+ geom_point(aes

Difference in legend position between ggplot and ggplotly?

余生长醉 提交于 2019-12-24 11:14:20
问题 I find out an interesting and strange difference between the same chart in ggplot and ggplotly income_gap_chart <- ggplot(income_gap, aes(x = Country, y = Percent, fill = Income)) + geom_bar(position = "dodge", stat = "identity") + scale_fill_brewer(palette = "Set1") + coord_flip() + theme(axis.title.y = element_blank()) + scale_y_continuous(limits = c(0, 100)) + theme_tufte() + theme(axis.title.y = element_blank()) + theme(legend.position = "bottom") For ggplot it looks perfect with a legend

Temporarily exclude points in plotly graph

徘徊边缘 提交于 2019-12-24 06:07:37
问题 In the following plotly example (taken from here), is it possible to introduce a function that allows the user to click on a point to 'grey it out', so it would be excluded from the 'active' dataset, and the loess fit line would automatically adjust to the new dataset? The point(s) could then be clicked again to bring them back into the 'active' data set. Could be tricky. As the comments suggest it will likely require shiny , but I’m having trouble figuring out how. library(plotly) library

Python ggplot and ggplotly

女生的网名这么多〃 提交于 2019-12-23 13:04:30
问题 Former R user, I used to combine extensively ggplot and plot_ly libraries via the ggplotly() function to display data. Newly arrived in Python, I see that the ggplot library is available, but cant find anything on a simple combination with plotly for graphical reactive displays. What I would look for is something like : from ggplot import* import numpy as np import pandas as pd a = pd.DataFrame({'grid': np.arange(-4, 4), 'test_data': np.random.random_integers(0, 10,8)}) p2 = ggplot(a, aes(x =

How to Export ggplotly from R shiny app as html file

只谈情不闲聊 提交于 2019-12-23 00:52:11
问题 I have a ggplotly object called p2 in my shiny app. I want it to work where if a user presses a downloadButton in the app UI, it will download the ggplotly plot as an html file. But the function doesn't work: output$Export_Graph <- downloadHandler( filename = function() { file <- "Graph" }, content = function(file) { write(p2, file) } Any ideas? 回答1: An interactive plotly graph can be exported as an "html widget". A minimal sample code is like the following: library(shiny) library(plotly)

Add custom data label in ggplotly scatterplot

做~自己de王妃 提交于 2019-12-21 05:44:09
问题 I would like to display the Species for each data point when the cursor is over the point rather than the than the x and y values. I use the iris dataset. Also I want to be able to click on a data point to make the label persistent and not get disapperaed when I choose a new spot in the plot. (if possible ). The basic is the label. The persistence issue is a plus. Here is my app: ## Note: extrafont is a bit finnicky on Windows, ## so be sure to execute the code in the order ## provided, or

Making a stacked bar plot based on ranges in R and plotly

元气小坏坏 提交于 2019-12-20 07:40:06
问题 I want to create a stacked bar chart in R and plotly using iris dataset. In the x-axis, I want to set limits like iris_limits below in the code and the y-axis should contain all the Sepal.Length values which fit into these ranges. I want to pass the values as a single vector. Also, if the limits can be made dynamic by understanding the range of the Sepal.Length instead of hard coding it, please help. I have written a basic script with values to give you an idea. Thanks. library(plotly) iris

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

允我心安 提交于 2019-12-20 06:33:59
问题 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!

Customizing the sankey chart to cater large datasets

社会主义新天地 提交于 2019-12-17 21:25:24
问题 kindly run the script below, I have created a Sankey chart in R and plotly using data from "patients" dataset of the bupaR library. Please see the snapshot for reference. The issue I am facing is that, this custom plot has been built by declaring and building each and every relationship between users("r1","r2",etc.) and activities("Registration","X-Ray, etc). If I have a large number of users and activities, it will become a very tedious task to declare each and every relation. Please help me