sanoke / hetviz Goto Github PK
View Code? Open in Web Editor NEWTreatment Effect Heterogeneity visualization using R
License: GNU General Public License v3.0
Treatment Effect Heterogeneity visualization using R
License: GNU General Public License v3.0
Use Javascript (or, worst-case scenario, a color change) to deactivate user elements that shouldn't be accessed at certain points of UI interaction.
The whiskers of the "boxplots" are calculated as 1.5*IQR, regardless of whether there's actually a datum out there. This needs to be corrected.
On their side of the middle 50%, the whisker should stop at the value that is \leq 1.5*IQR.
Add an adjustable horizontal highlighting bar to the Subgroup Profile tab and the Covariate Profile tab. This will help the user more clearly see deviations.
At the moment, everything is plotted all at once. Is there a better way?
Want to add in some better internal documentation.
Within each pane, write in some comments + an example screenshot of what the user should expect to see. This includes information on the calculations used to generate the plot. This will be in the User Manual, and a link to the appropriate page will be provided in the UI.
At the moment, the progress bar update amounts are somewhat arbitrary. Would like to write a function to determine how much to increment (which is dependent on what type of plot is being generated) and use that function to do the increments.
The correct figure is generated, but a weird error is printed to the console. It also looks like the app is doing calculations twice...?
Warning: Error in eval: incorrect length (0), expecting: 9215
Stack trace (innermost first):
96: <Anonymous>
95: stop
94: filter_impl
93: filter_.tbl_df
92: filter_
91: as.data.frame
90: filter_.data.frame
89: filter_
88: dplyr::filter
87: eval
86: eval
85: %>%
84: vizByCovar [/Users/Baloo/GitHub/hetviz-dev/R/vizByCovar-plotFcn.R#194]
83: eval [/Users/Baloo/GitHub/hetviz-dev/inst/shiny/server.R#519]
82: eval
81: withProgress
80: "plotly"::"ggplotly" [/Users/Baloo/GitHub/hetviz-dev/inst/shiny/server.R#517]
79: func
78: origRenderFunc
77: output$vizByCovar
2: shiny::runApp
1: hetviz [/Users/Baloo/GitHub/hetviz-dev/R/runShinyApp.R#18]
I've been conflating the identification of dichotomous and polytomous covariates -- because they've been the same in the test data I've been using.
But at some point, I will need to separate this out and handle them differently.
Final steps...
When generating the forest plot, get a new error:
> hetviz()
Listening on http://127.0.0.1:6353
Warning in origRenderFunc() :
Ignoring explicitly provided widget ID "95a4fa9b92a"; Shiny doesn't use them
Shiny was updated a few days ago and there's at least one person reporting the same error.
readr::as_tibble()
tibble
ifelse()
syntax that was checking whether the passed data is a data.frame
or a tibble
Would like the app to be able to connect to a remote database, and pull data for visualization.
The initial plot takes a while to load, as does any modifications to the plot.
withProgress()
doesn't help, because I would need to add incProgress()
calls within the definition of plotly::renderPlotly()
.
So, need to research how to display some sort of busy signal to the user while the plot completes its rendering.
Would like the user to be able to create a summary document of plots and annotations from the application. Will need to put some thought into what this document will look like. But it will contain (list updated regularly):
plotly::ggplotly()
doesn't have an analog to ggvis::bind_shiny()
... in other words, it's not possible to dynamically create plotly
plots, although it is in ggvis
(e.g., each iteration of a for()
loop generating a plot whose name depends on the iteration number of the loop).
So for now, I will use ggvis()
but make a note for the future to program this functionality myself (this is a nontrivial task) and/or suggest to the plotly developers to create such a function.
[Moved from sanoke/hetviz-dev#44]
Put the function definition in R/summaryFcns.R
and add it to the dataCompat()
definition, where data is prepared for plotting.
This calculation is done for most of the features, so a function should be written to do this, and the results cached.
Can do this calculation inside the observeEvent()
for the start button.
[Moved from sanoke/hetviz-dev#40]
... let the user define what "small" is?
Such a button is important because the small subgroups are often the ones with the extreme values, and can be distracting within the plot.
There are two options here.
Plots with a lot of subgroups and/or observations take a long time to generate, and caching would help speed things up.
When a dataset is loaded, the names of certain variables (outcome, treatment, subgroup indicator, estimated ITR (if provided)) are changed to be compatible with some hard-coding.
These 'new' compatible names are contained in plots containing these data. Instead, these plots should display the name contained in the user's data.
[An issue in the 'Viz by Subgroup' tab]
This issue is indicative of a larger problem, ensuring that the variable containing subgroup membership is coded properly.
Proper coding means that this variable takes consecutive integer values, starting at 1. Groups are numbered in order of increasing subgroup-specific average treatment effect (ATE).
At the moment, proper coding is an assumption, and I need to write a function to enforce it. If there's an empty subgroup / invalid subgroup number, no plots will display. (There's a notice to this effect in the panel.)
In the interim, I'll provide a script for the user to do this check themselves. Eventually I will do this check within my application, and do some reassignment as needed.
The initial thought was that typing the name of the variable would be faster than scrolling through a long list. Will need to get feedback on this...
On GitHub, this demo version will live in its own branch. It will demonstrate functionalities on simulated data (user will have to download app to run on actual data).
[Moved from sanoke/hetviz-dev#46]
[Moved from sanoke/hetviz-dev#38]
TravisCI is including files in its package builds that it's not supposed to be (as per .Rbuildignore
). Not sure if this is an issue of settings on my part or a bug within Travis.
At the moment the tooltip contains ggplotly()
default text. This text needs to be revised to contain more helpful information.
[Moved from sanoke/hetviz-dev#7]
[Related to #24]
Proper subgroup coding means that this variable takes consecutive integer values, starting at 1. Groups are numbered in order of increasing subgroup-specific average treatment effect (ATE).
At the moment, proper coding is an assumption, and I need to write a function to create/enforce it. If there's an empty subgroup / invalid subgroup number, no plots will display. (There's a notice to this effect in the panel.)
Write function to check that grouping variable is coded properly. Do group reassignment if needed.
In the interim, I'll provide a script for the user to do this check themselves. Eventually I will do this check within my application, and do some reassignment as needed.
Trying to generate viz with user-provided data selected and no data actually uploaded crashes the app:
Warning: Error in if: argument is of length zero
Stack trace (innermost first):
66: observeEventHandler [/Library/Frameworks/R.framework/Versions/3.4/Resources/library/hetviz/shiny/server.R#120]
2: shiny::runApp
1: hetviz [/Users/cchoirat/Documents/LocalGit/hetviz/R/runShinyApp.R#20]
At the moment, the character is a small hollow circle. Would like this to be a filled circle.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.