Learn R Programming

aNCA (version 0.1.0)

multiple_matrix_ratios: Calculate Matrix Ratios This function calculates the ratios for a given data set, based on the shared time points for each matrix concentration sample. The user can input multiple tissues for which ratios should be calculated.

Description

The ratios are calculated as specimen1 / specimen 2.

Usage

multiple_matrix_ratios(
  data,
  matrix_col,
  conc_col,
  units_col,
  groups = c("NFRLT", "USUBJID"),
  spec1,
  spec2
)

Value

A data frame containing the ratios.

Arguments

data

A data frame containing the concentration data.

matrix_col

A character string specifying the column name for the matrix type.

conc_col

A character string specifying the column name for the concentration data.

units_col

A character string specifying the column name for the units.

groups

A character vector of grouping variables to use for the analysis. Must include time column, USUBJID, and optionally, other grouping variables.

spec1

A character string specifying the value for the first specimen type(s) in the matrix_col.

spec2

A character string specifying the value for the second specimen type(s) in the matrix_col.

Examples

Run this code
data <- data.frame(
  USUBJID = c("A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A", "A"),
  NFRLT = c(0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2),
  MATRIX = c(
    "BLOOD", "BLOOD", "BLOOD", "PLASMA", "PLASMA", "PLASMA",
    "BRAIN", "BRAIN", "BRAIN", "LIVER", "LIVER", "LIVER"
  ),
  CONC = c(10, 20, 15, 25, 30, 40, 5, 10, 8, 12, 18, 16),
  UNITS = rep("ng/mL", 12)
)
multiple_matrix_ratios(data, "MATRIX", "CONC", "UNITS", c("NFRLT", "USUBJID"), "BLOOD", "PLASMA")

Run the code above in your browser using DataLab