Reads a Pmetrics .csv matrix input file into R.
This function is largely superseded as the function is called automatically
when data are intialized as a PM_data object with PM_data$new()
. There
is rarely need to call PMreadMatrix()
directly any longer.
Usage
PMreadMatrix(
file,
sep = getPMoptions("sep"),
dec = getPMoptions("dec"),
quiet = F,
...
)
Arguments
- file
The name of the file to be loaded, including the full path if not in the current working directory (check with getwd).
- sep
Delimiter between columns, which is a comma by default, but can be changed with setPMoptions.
- dec
Decimal separator, which is a period by default, but can be changed with setPMoptions.
- quiet
Default is
FALSE
. IfTRUE
, there will be no report to the console on the contents of file.- ...
Other parameters to be passed to
readr::read_delim()
Value
PMreadMatrix
returns a data frame of class "PMmatrix".
If the file is successfully read and quiet=F
,
the column headers will be reported to the console as a validation check.
Note that this function converts the column headers in the
file
from upper to lowercase for convenient referencing in R.
Details
As of Pmetrics version 2, the structure of a valid .csv file relaxed.
Minimal required columns are id, time, dose, and out. This function is now included
as part of the PM_data R6 object to create new PM_data
objects. Users should
rarely have a need to call PMreadMatrix
as a standalone function unless they
continue to use Pmetrics in its legacy mode (versions < 2.0). Note that support
for legacy Pmetrics will eventually wither as the package evolves.
There are a number of other options for columns in the data input. Details can be found in the documentation.
See also
PMwriteMatrix, PMcheck, and plot.PM_data