Description Usage Arguments Value See Also Examples
Create block randomisation list documents in three possible formats: HTML, PDF (requires LaTeX) and Microsoft Word
1 2 3 4 5 | createRandomisationDoc(patients, strataVars, treatments, header = list(title =
"Randomisierungsliste zur Studie: title", author = "author", date =
Sys.Date()), format = c("html", "word", "pdf"), newpage = FALSE,
file.rmd = system.file("extdata", "randomList.Rmd", package = "blockrand2"),
outdir = file.path(tempdir(), "blockrand2"))
|
patients |
data frame containing the patient's data as returned by
|
strataVars |
List of strata variables, each of which is defined in the form of a vector of possible (character) values. |
treatments |
named vector of character defining the possible treatments. The names are used as acronyms, the values as the full treatment names |
header |
list with elements |
format |
vector of elements from |
newpage |
if |
file.rmd |
full path to the RMarkdown file that is rendered to create
the randomisation list documents. By default the file |
outdir |
full path to the output directory to which the created document
files are written. By default the files are written to a subfolder
|
list containing the full paths to the created files as values and the
file extensions (html, docx, pdf
) as element names
https://github.com/hsonne/blockrand2 (provides a short tutorial in the README file)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | ## Not run:
# Define title of the study, the author and the date
header <- list(
title = "Randomisation lists for the study: *Jokes against craziness*",
author = "Hauke Sonnenberg",
date = "2016-08-27"
)
# Define stratum variables
strataVars <- list(
sex = c("male", "female"),
crazyness = c("weak", "medium", "strong")
)
# Define the treatments
treatments <- c(
joke = "Tell funny jokes",
nojoke = "Keep serious!"
)
# Create some patient's testdata using the stratum levels
patients <- createTestdata(strataVars, 40)
# Create the randomisation list documents. We store the paths to the created
# files that are returned invisibly by createRandomisationDoc() in a variable
files <- createRandomisationDoc(
patients = patients,
strataVars = strataVars,
treatments = treatments,
header = header,
newpage = TRUE
)
# Show the paths of the created files
files
# Open the html file in the default browser
browseURL(files$html)
# Open the pdf file in the default PDF viewer
system(paste(getOption("pdfviewer"), files$pdf))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.