popedGetMultipleEndpointModelingTimes: Get Multiple Endpoint Modeling Times

View source: R/RcppExports.R

popedGetMultipleEndpointModelingTimesR Documentation

Get Multiple Endpoint Modeling Times

Description

This function takes a vector of times and a corresponding vector of IDs, groups the times by their IDs, initializes an internal C++ global TimeIndexer, that is used to efficiently lookup the final output from the rxode2 solve and then returns the sorted unique times.

The popedMultipleEndpointIndexDataFrame() function can be used to visualize the internal data structure inside R, but it does not show all the indexes in the case of time ties for a given ID. Rather it shows one of the indexs and the total number of indexes in the data.frame

Usage

popedGetMultipleEndpointModelingTimes(times, modelSwitch, sorted = FALSE)

popedMultipleEndpointIndexDataFrame(print = FALSE)

Arguments

times

A numeric vector of times.

modelSwitch

An integer vector of model switch indicator corresponding to the times

sorted

A boolean indicating if the returned times should be sorted

print

boolean for popedMultipleEndpointIndexDataFrame() when TRUE show each id/index per time even though it may not reflect in the returned data.frame

Value

A numeric vector of unique times.

Examples





times <- c(1.1, 1.2, 1.3, 2.1, 2.2, 3.1)
modelSwitch <- c(1, 1, 1, 2, 2, 3)
sortedTimes <- popedGetMultipleEndpointModelingTimes(times, modelSwitch, TRUE)
print(sortedTimes)

# now show the output of the data frame representing the model
# switch to endpoint index

popedMultipleEndpointIndexDataFrame()

# now show a more complex example with overlaps etc.

times <- c(1.1, 1.2, 1.3, 0.5, 2.2, 1.1, 0.75,0.75)
modelSwitch <- c(1, 1, 1, 2, 2, 2, 3, 3)
sortedTimes <- popedGetMultipleEndpointModelingTimes(times, modelSwitch, TRUE)
print(sortedTimes)

popedMultipleEndpointIndexDataFrame(TRUE) # Print to show individual matching



nlmixr2/babelmixr documentation built on Nov. 21, 2024, 3:16 a.m.