Learn R Programming

spiro (version 0.2.3)

knit_print.spiro: Printing spiro data frames in a knitr context

Description

knit_print.spiro() provides a method for printing data.frames from spiro within knitr.

Usage

# S3 method for spiro
knit_print(x, min = 10, max = 20, digits = 2, ...)

Value

The function prints its argument and returns it invisibly.

Arguments

x

A data.frame of the class spiro to be printed.

min

An integer, which sets the number of rows to which x will be limited in printing if row number exceed max.

max

An integer, setting the maximal number of rows to be not cut to min in printing.

digits

An integer giving the number of decimals to be rounded to.

...

Passing of additional arguments to knit_print.default().

Details

Cardiopulmonary exercise testing data imported by spiro will often come in large data.frames. When knitting R Markdown documents these will normally be printed in full size.

This function provides a method for data.frames of the class spiro to limit the number of rows displayed to min if it exceeds max. The number of hidden data rows will be printed below the data.frame.

Examples

Run this code
# Get example data
s <- spiro(spiro_example("zan_gxt"))

knitr::knit_print(s)

Run the code above in your browser using DataLab