README.md

minimal R versionORCiD

CTRU R Functions

This repository contains R functions to facilitate work at the Sheffield Clinical Trials Research Unit (CTRU), part of the School of Health and Related Research (ScHARR) at The University of Sheffield. The intention is to share code between colleagues so that common repetitive tasks become trivial and we do not spend time solving the same problems.

Readers may also find the following slides useful. They are written by the author of this package and contain a host of examples and links to additional resoures on using R in a reproducible workflow...

Installation and Usage

If all you want to do is use these functions then its pretty straight-forward to install them thanks to the devtools package. Install it from CRAN and then install this repository from GitHub...

install.packages('devtools')
devtools::install_github('ns-ctru/ctru')
## And of course load the library
library(ctru)

You can now use the functions read_prospect(), fields_prospect() and so forth.

Shiny Application(s)

The package now includes a Shiny application (i.e. interactive Web page) that allows the calculation of sample sizes using a number of different R packages. A helper function is included so that once you have installed and loaded the library (as describved above) you can start the application using...

ctru_shiny()

Read more about the included Shiny applications below.

Collaborating

To collaborate in this work you will need to install Git on your computer and have a GitHub account. If you're not familiar with either of these you may find the tutorial Conversational Git a useful place to start. The GitHub help pages are also excellent.

Once you've got a GitHub account you need to fork the ns-ctru/ctru repository, clone your fork to your computer to work on it, make changes/addition and push them back to your fork then make a make pull requests.

SSH Keys

I would advocate using SSH Keys with your GitHub account to make it easy to push updates without having to enter your password every single time.

Functions

read_prospect()

ToDo

recruitment()

ToDo

table_summary()

ToDo

plot_summary()

ToDo

idm_lsoa()

ToDo

eq5d_score()

ToDo

consort()

ToDo

regress_ctru()

ToDo

Shiny Applications

Shiny applications are included in this packages (currently n = 1). A helper function (ctru_shiny()) is included to start the different applications. It includes the option to specify the display.mode which can be useful if you wish to look at the source code in the application (use the option display.mode = "showcase" if so).

Sample Size Calculations

A WebUI to a number of R packages which will calculate sample sizes and/or power for the specified parameters. . To start it run...

ctru_shiny(example = 'sample_size')

Links

A few links to other resources that people might find useful...



ns-ctru/ctru documentation built on May 23, 2019, 9:34 p.m.