exclude_nca_by_param: Exclude NCA Results Based on Parameter Thresholds

View source: R/exclude_nca.R

exclude_nca_by_paramR Documentation

Exclude NCA Results Based on Parameter Thresholds

Description

Exclude rows from NCA results based on specified thresholds for a given parameter. This function allows users to define minimum and/or maximum acceptable values for a parameter and excludes rows that fall outside these thresholds.

Usage

exclude_nca_by_param(
  parameter,
  min_thr = NULL,
  max_thr = NULL,
  affected_parameters = parameter
)

Arguments

parameter

The name of the PKNCA parameter to evaluate (e.g., "span.ratio").

min_thr

The minimum acceptable value for the parameter. If not provided, is not applied.

max_thr

The maximum acceptable value for the parameter. If not provided, is not applied.

affected_parameters

Character vector of PKNCA parameters that will be marked as excluded. By default is the defined parameter.

Value

A function that can be used with PKNCA::exclude to mark through the 'exclude' column the rows in the PKNCA results based on the specified thresholds for a parameter.

Examples

# Example dataset
my_data <- PKNCA::PKNCAdata(
  PKNCA::PKNCAconc(data.frame(conc = 5:1,
                              time = 0:4,
                              subject = 1),
                   conc ~ time | subject),
  PKNCA::PKNCAdose(data.frame(subject = 1, dose = 100, time = 0),
                   dose ~ time | subject)
)
my_result <- PKNCA::pk.nca(my_data)

# Exclude rows where span.ratio is less than 2
excluded_result <- PKNCA::exclude(
  my_result,
  FUN = exclude_nca_by_param("span.ratio", min_thr = 2)
)
as.data.frame(excluded_result)


PKNCA documentation built on Aug. 21, 2025, 6 p.m.