accgph: Create monthly accrual graph

Description Usage Arguments Value Author(s) Examples

View source: R/accgph.R

Description

This is a function to create accrual graphs for trials. Similar output to the %accgph() macro.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
accgph(
  data,
  protnum,
  id = "dcntr_id",
  date.on,
  open.dt,
  froz.dt,
  expmth = 0,
  y.breaks = round(y.lim/10, -1),
  exp.pts,
  y.lim = nrow(one)
)

Arguments

data

The dataset with the patients you want to use. Must contain patient IDs and patient "on date"

protnum

The study number as a character.

id

The patient ID variable in quotes used in the dataset

date.on

The variable that contains the patient "on date". Entered as character.

open.dt

The study open date. Alternatively, the lower limit for date you want to use for the start of the graph. Entered in "mm/dd/yyyy" format.

froz.dt

The upper limit for the patient "on dates". Entered in "mm/dd/yyyy" format.

expmth

The number of expected patients accrued per month. Available in protocol.

y.breaks

The distance between each y-axis break. Default is y.lim/10 rounded to the nearest 10.

exp.pts

The number of patient expected to be accrued for the study

y.lim

Limit for y-axis. Default is the number of rows in the given dataset.

Value

This function creates a month by month accrual graph.

Author(s)

Sawyer Jacobson

Adam Pettinger

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#With data loaded for A041501

crtlibn(d = 'A041501')

accrual <- accgph(protnum = "A041501", 
    data = crse, id = "dcntr_id", 
    date.on = "date_on",
    open.dt = "06/15/2018",
    froz.dt = format(Sys.Date(), "%m/%d/%Y"), 
    expmth = 5, exp.pts = 324) 
accrual

sjacobson94/clinicaltrials documentation built on Oct. 27, 2020, 6:43 p.m.