Learn R Programming

mrgsolve (version 1.5.1)

mrgsims_dplyr: Methods for handling output with dplyr verbs

Description

These methods modify the data in a mrgsims object and return a data frame. Contrast with the functions in mrgsims_modify.

Usage

# S3 method for mrgsims
pull(.data, ...)

# S3 method for mrgsims filter(.data, ...)

# S3 method for mrgsims group_by(.data, ..., add = FALSE, .add = FALSE)

# S3 method for mrgsims distinct(.data, ..., .keep_all = FALSE)

# S3 method for mrgsims mutate(.data, ...)

# S3 method for each summarise(.data, funs, ...)

# S3 method for mrgsims summarise(.data, ...)

# S3 method for mrgsims do(.data, ..., .dots)

# S3 method for mrgsims select(.data, ...)

# S3 method for mrgsims slice(.data, ...)

as_data_frame.mrgsims(x, ...)

# S3 method for mrgsims as_tibble(x, ...)

as.tbl.mrgsims(x, ...)

Arguments

.data

an mrgsims object; passed to various dplyr functions

...

passed to other methods

add

passed to dplyr::group_by (for dplyr < 1.0.0)

.add

passed to dplyr::group_by (for dplyr >= 1.0.0)

.keep_all

passed to dplyr::distinct

funs

passed to dplyr::summarise_each

.dots

passed to various dplyr functions

x

mrgsims object.

Details

For the select_sims function, the dots ... must be either compartment names or variables in $CAPTURE. An error will be generated if no valid names are selected or the names for selection are not found in the simulated output.

See Also

mrgsims_modify

Examples

Run this code

out <- mrgsim(house(), events = ev(amt = 100), end = 5, delta=1)

dplyr::filter(out, time==2)

dplyr::mutate(out, label = "abc")

dplyr::select(out, time, RESP, CP)

Run the code above in your browser using DataLab