Skip to contents

PM_data R6 objects containing raw, standardized and valid data, and methods to process the data

Details

PM_data objects are passed to PM_fit objects to initiate a population analysis. The object is created by reading a delimited file in the current working directory. The data will be transformed into the standard format which is the same for all engines, with a report of any assumptions that were necessary to standardize the data. PMcheck is called on the standard data to evaluate for errors. If dates and times are converted to relative decimal times in the standard data, automatic detection of the correct format will be attempted using lubridate::parse_date_time(). In the case of failure due to an unusual format, use the 'dt' argument to specify the correct format in your data. In the case of successful automatic detection, the format used will be included in the standardization report generated upon creation of a new PM_data object. Check carefully to make sure the correct format was chosen. Note that if your clock times did not include seconds, they were appended as ":00" to the end of each time and will appear that way in the copy of the original data.

There are a number of methods defined for a PM_data object, including to write the standard data back to a file for future use, to summarize and to plot the object, and to conduct a non-compartmental analysis on the raw data using makeNCA.

Public fields

data

Data frame containing the data to be modeled

standard_data

Data frame containing standardized version of the data

Methods


Method new()

Create new data object

Usage

PM_data$new(data, dt = NULL, quiet = F)

Arguments

data

A quoted name of a file with full path if not in the working directory, or an unquoted name of a data frame in the current R environment.

dt

Pmetrics will try a variety of date/time formats. If all 16 of them fail, use this parameter to specify the correct format as a character vector whose first element is date format and second is time. Use the following abbreviations:

  • Y = 4 digit year

  • y = 2 digit year

  • m = decimal month (1, 2, ..., 12)

  • d = decimal day (1, 2, ..., 31)

  • H = hours (0-23)

  • M = minutes (0-59) Example: format = c("myd", "mh"). Not one of the tried combinations! Always check to make sure that dates/times were parsed correctly and the relative times in the PM_data$standard_data field look correct. Other date/time formats are possible. See lubridate::parse_date_time() for these.

quiet

Quietly validate. Default is FALSE.

Details

Creation of a new PM_data objects from a file or a data frame. Data will be standardized and checked automatically to a fully specified, valid data object.


Method write()

Write data to file

Usage

PM_data$write(file_name)

Arguments

file_name

A quoted name of the file to create with full path if not in the working directory.

Details

Writes a delimited file (e.g. comma-separated) from the standard_data field


Method nca()

Perform non-compartmental analysis

Usage

PM_data$nca(...)

Arguments

...

Arguments passed to makeNCA.

Details

See makeNCA.


Method plot()

Plot method

Usage

PM_data$plot(...)

Arguments

...

Arguments passed to plot.PM_data

Details

See plot.PMmatrix.


Method print()

Print method

Usage

PM_data$print(standard = F, viewer = T, ...)

Arguments

standard

Display the standardized data if TRUE. Default is FALSE.

viewer

Display the Viewer if TRUE. Default is TRUE.

...

Other arguments to print.data.frame. Only passed if viewer = FALSE.

Details

Displays the PM_data object in a variety of ways.


Method summary()

Summary method

Usage

PM_data$summary(...)

Arguments

...

Arguments passed to summary.PMmatrix.

Details

See summary.PMmatrix.


Method clone()

The objects of this class are cloneable with this method.

Usage

PM_data$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.