View source: R/plot_recruitment.R
plot_recruitment | R Documentation |
secuTrialdata
objectssecuTrial exports inherently contain the information on which participant was registered at which point in time. This function makes use of this property to plot recruitment over time. Centers indicated with a black line in the legend did not recruit at all.
plot_recruitment(
x,
return_data = FALSE,
show_centres = TRUE,
cex = 1,
rm_regex = ""
)
x |
a |
return_data |
logical - return the data used to produce the plot instead of the plot |
show_centres |
logical - subset the data into centres |
cex |
double - specifies font size in legend |
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. |
a simple line plot showing recruitment over time or a list of data.frames if return_data is set to TRUE
# 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
plot_recruitment(sT_export)
# plot without trailing bracket
plot_recruitment(sT_export, rm_regex = "\\(.*\\)$")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.