R: Create a simulation data set from ev objects

as_data_set {mrgsolve} | R Documentation

## Create a simulation data set from ev objects

### Description

Create a simulation data set from ev objects

### Usage

    as_data_set(x, ...)

    ## S4 method for signature 'ev'
    as_data_set(x, ...)

    ## S4 method for signature 'data.frame'
    as_data_set(x, ...)

### Arguments

`x` | ev objects
`...` | more ev objects

### Details

The goal is to take a series of event objects and combine them into a single data set that can be passed to `data_set`. Each event object is added to the data frame as an `ID` or set of `ID`s that are distinct from the `ID`s in the other event objects. Note that including `ID` argument to the `ev` call where `length(ID)` is greater than one will render that set of events for all of `ID`s that are requested.

To get a data frame with one row (event) per `ID` look at `expand.ev`.

### Value

a data frame suitable for passing into `data_set`

### Examples

    as_data_set(ev(amt=c(100,200), cmt=1, ID=1:3),
                ev(amt=300, time=24, ID=1:2),
                ev(amt=1000, ii=8, addl=10, ID=1:3))

    # Instead of this, use expand.ev
    as_data_set(ev(amt=100), ev(amt=200),ev(amt=300))

[Package mrgsolve version 0.11.1 Index]