Learn R Programming

rsurfer (version 0.2)

subjectDistributionTableToLatex: Convert Subject Distribution Table To LaTeX

Description

Converts a subject distribution table created using subjectDistributionTable() into text which can be used in the typesetting language LaTeX. The table created can have its caption and label specified using the respective function arguments. The decimal point rounding can be specified by the function argument roundDP.

Usage

subjectDistributionTableToLatex(subjectDistributionTable,
  caption = "Placeholder Caption", label = "table:SubjectDistributionTable",
  roundDP = 1)

Arguments

subjectDistributionTable

The subject distribution table created using subjectDistributionTable()

caption

The caption to give the table in LaTeX

label

The label to give the table in LaTeX

roundDP

The number of decimal places to round the numbers to on the table

Value

The LaTeX code representing the subject distribution table

Examples

Run this code
# NOT RUN {
all <- generaterandomsubjects(1000)
all$Age <- stats::runif(1000,50,80)
all <- addrandomgender(all)
all <- addrandomdiagnosis(all)
sdt <- subjectDistributionTable(all, "Diagnosis")
subjectDistributionTableToLatex(subjectDistributionTable = sdt,
                                caption="Subject Distribution Table",
                                label="table:SDT", roundDP=1)
# }

Run the code above in your browser using DataLab