Site icon R-bloggers

R/Shiny for clinical trials: simple randomization tables

[This article was first published on R – Tales of R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

One of the things I most like from R + Shiny is that it enables me to serve the power and flexibility of R in small “chunks” to cover different needs, allowing people not used to R to benefit from it. However, what I like most is that’s really fun and easy to program those utilities for a person without any specific programming background.

Here’s a small hack done in R/Shiny: it covered an urgent need for a study involving patient randomisation to two branches of treatment, in what is commonly known as a clinical trial. This task posed some challenges:

To tackle the points above, my app should have two main features:

Here’s how I got it to work:

Unfortunately I wasn’t able to insert iframes to embed the app, so I posted a screenshot:

 

The app is far from perfect, but it covers the basic needs for the trial. You can test it here:

http://aurora.shinyapps.io/random_gen

And the GitHub repo is available here.

https://github.com/aurora-mareviv/random_gen

https://github.com/aurora-mareviv/random_gen/blob/master/server.R

https://github.com/aurora-mareviv/random_gen/blob/master/ui.R

Feel free to use/ adapt/ fork it to your needs!

 

 

 

 

 

 


To leave a comment for the author, please follow the link and comment on their blog: R – Tales of R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.