Plot13CRecord: Plot a 13C record and fit results

Description Usage Arguments Value Author(s) Examples

View source: R/PlotRecord.R

Description

Reads record from database and plots raw data, fit, and extracted coefficients

Usage

1
2
3
Plot13CRecord(con, breathTestRecordID, showParameters = NULL,
  ymax = NULL, xmax = NULL, showName = FALSE,
  showPopulationFit = FALSE)

Arguments

con

Open connection to SQLite database; use OpenSqliteConnection to connect.

breathTestRecordID

BreathTestRecordID in database; used in tables BreathTestRecord (primary), BreathTestParameter, BreathTestTimeSeries (foreign).

showParameters

The parameters to display in the graph as a data frame with column Parameter (t50, tlag,GEC) and Method (BreathID, BluckCoward, Maes). If Method is NA, all variants of Parameter are shown. By default, shows all variants of t50.

ymax

Vertical scaling; default of NULL is for autoscaling

xmax

Time axis scaling; default of NULL is for autoscaling

showName

Show full patient name and DOB, initials otherwise

showPopulationFit

If available, show population fit as a red curve. If the single fit fails, and there is a valid population fit, this is always shown.

Value

A ggplot2 graphics object

Author(s)

Dieter Menne, dieter.menne@menne-biomed.de

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
if (exists("con")) suppressWarnings(dbDisconnect(con))
sqlitePath = tempfile(pattern = "Gastrobase", tmpdir = tempdir(), fileext = ".sqlite")
unlink(sqlitePath)
CreateEmptyBreathTestDatabase(sqlitePath)
con = OpenSqliteConnection(sqlitePath)
filename = system.file("extdata", "350_20043_0_GER.txt", package = "D13CBreath")
breathTestRecordID = AddBreathTestRecord(filename,con)
showParameters = data.frame(Parameter="t50",Method = c("BreathID","BluckCoward"))
Plot13CRecord(con,breathTestRecordID)
Plot13CRecord(con,breathTestRecordID, showParameters)
dbDisconnect(con)

dmenne/d13cbreath documentation built on March 1, 2020, 3:41 a.m.