Learn R Programming

secuTrialR (version 1.1.1)

annual_recruitment: Returns a data.frame showing the annual recruitment per center

Description

secuTrial exports inherently contain the information on which participant was registered at which point in time. This function makes use of this property to show annual recruitment.

Usage

annual_recruitment(x, rm_regex = "")

Value

a data.frame showing the annual recruitment counts per center

Arguments

x

a secuTrialdata object

rm_regex

character - specifies a regular expression to be removed from the centre names in the legend. e.g. rm_regex = "\\(.*\\)$" will remove trailing brackets and their contents.

Examples

Run this code
# export location
expot_loc <- system.file("extdata", "sT_exports", "lnames",
                         "s_export_CSV-xls_CTU05_long_ref_miss_en_utf8.zip",
                         package = "secuTrialR")
# read export
sT_export <- read_secuTrial(expot_loc)

# plot recruitment
annual_recruitment(sT_export)

# show without trailing bracket
annual_recruitment(sT_export, rm_regex = "\\(.*\\)$")

Run the code above in your browser using DataLab