Use this function to allow your table to span multiple pages, with a
"to be continued" statement at the bottom of each page. There are important
differences between this longtable environment and the tabular
environment that is used to generate tables from stable(). See the
details section for more information.
Usage
stable_long(data, ...)
# S3 method for class 'data.frame'
stable_long(
data,
note_config = noteconf(type = "minipage"),
inspect = FALSE,
lt_cap_macro = "",
lt_cap_text = "",
lt_cap_short = "",
lt_cap_label = "",
lt_continue = "\\footnotesize{continued on next page}",
...
)
# S3 method for class 'stobject'
stable_long(data, ...)
# S3 method for class 'pmtable'
stable_long(data, ...)Arguments
- data
an object to render as a long table; this could be a
data.frame, apmtableobject or anstobject; when passing in adata.frame, the data should be filtered or subset so thatdatacontains exactly the rows (and columns) to be processed; pmtables will not add or remove rows prior to processingdata- ...
passed to
stable()- note_config
a
noteconf()object used to configure how table notes are displayed; see alsost_noteconf().- inspect
fixed to
TRUEand passed tostable()- lt_cap_macro
the name of a macro that will hold caption text; to not lead with
\\- this will be added for you- lt_cap_text
full caption text, appearing where the table is rendered
- lt_cap_short
short caption text, appearing in the list of tables
- lt_cap_label
table label for use in latex document
- lt_continue
longtable continuation message
Value
A character vector with the TeX code for the table with class
attribute set to stable_long and stable.
Details
To create longtable output, pmtables first passes the data frame
through stable() and then modifies the output to create a table in
longtable environment. The ... arguments to stable_long() are passed
to stable() and can be used to configure the table. One important difference
between tablular and longtable environments is that captions need to
get inserted inside the longtable environment; this is why you see
several additional arguments for stable_long().
You may have to run pdflatex on your longtable more than once to get the
table to render properly; this is not unexpected behavior for longtable.
If you have panels in your table, the default is to prevent page breaks
right after the panel title row using the \\* command in the longtable
package. This shouldn't need to be changed by the user, but if needed this
can be suppressed by adding nopagebreak = FALSE when calling as.panel()
or rowpanel().
Examples
stable_long(stdata())
#> [1] "\\renewcommand{\\arraystretch}{1.3}"
#> [2] "\\setlength{\\tabcolsep}{5pt} "
#> [3] "\\setlength{\\extrarowheight}{0em}"
#> [4] "\\begin{longtable}{lllllllll}"
#> [5] "\\endhead"
#> [6] "\\hline"
#> [7] "\\multicolumn{9}{r}{\\footnotesize{continued on next page}}"
#> [8] "\\endfoot"
#> [9] "\\hline"
#> [10] "\\endlastfoot"
#> [11] "\\hline"
#> [12] "STUDY & DOSE & FORM & N & WT & CRCL & AGE & ALB & SCR \\\\"
#> [13] "\\hline"
#> [14] "\\endfirsthead"
#> [15] "\\hline"
#> [16] "STUDY & DOSE & FORM & N & WT & CRCL & AGE & ALB & SCR \\\\"
#> [17] "\\hline"
#> [18] "\\endhead"
#> [19] "\\hline"
#> [20] "12-DEMO-001 & 100 mg & tablet & 80 & 71.4 & 104 & 33.7 & 4.20 & 1.06 \\\\"
#> [21] "12-DEMO-001 & 150 mg & capsule & 16 & 89.4 & 122 & 24.4 & 4.63 & 1.12 \\\\"
#> [22] "12-DEMO-001 & 150 mg & tablet & 48 & 81.7 & 104 & 34.4 & 3.83 & 0.910 \\\\"
#> [23] "12-DEMO-001 & 150 mg & troche & 16 & 94.0 & 93.2 & 27.4 & 4.94 & 1.25 \\\\"
#> [24] "12-DEMO-001 & 200 mg & tablet & 64 & 67.9 & 100 & 27.5 & 4.25 & 1.10 \\\\"
#> [25] "12-DEMO-001 & 200 mg & troche & 16 & 76.6 & 99.2 & 22.8 & 4.54 & 1.15 \\\\"
#> [26] "12-DEMO-002 & 100 mg & capsule & 36 & 61.3 & 113 & 38.3 & 4.04 & 1.28 \\\\"
#> [27] "12-DEMO-002 & 100 mg & tablet & 324 & 77.6 & 106 & 29.9 & 4.31 & 0.981 \\\\"
#> [28] "12-DEMO-002 & 50 mg & capsule & 36 & 74.1 & 112 & 37.1 & 4.44 & 0.900 \\\\"
#> [29] "12-DEMO-002 & 50 mg & tablet & 324 & 71.2 & 106 & 34.1 & 4.63 & 0.868 \\\\"
#> [30] "12-DEMO-002 & 75 mg & capsule & 36 & 72.4 & 105 & 38.2 & 3.89 & 0.900 \\\\"
#> [31] "12-DEMO-002 & 75 mg & tablet & 288 & 71.6 & 98.9 & 34.2 & 4.49 & 0.991 \\\\"
#> [32] "12-DEMO-002 & 75 mg & troche & 36 & 73.6 & 103 & 49.2 & 4.52 & 0.930 \\\\"
#> [33] "\\hline"
#> [34] "\\end{longtable}"
#> attr(,"class")
#> [1] "stable_long" "stable"
