mcwr_exit {mcwr}R Documentation

Examine last (exit) row of data set

Description

mcwr_exit() allows easy editing and consistency checks of the last (exit) row of an mcwr data frame.

Usage

mcwr_exit(data, age, replace = FALSE, update = FALSE, rewards = 0)

Arguments

data

an mcwr data.frame

age

a real number ageval. It specifies the age of the exit row in the data frame. It may or may not exist. It may not be smaller than the largest age in the data frame.

If ageval corresponds to the largest age in the data frame, option replace must be specified. The values of the corresponding row are replaced. Exit transition values for p-variables are set to 1. Exit transition values for r-variables are left as-is if they are non-missing and option update is not used. Otherwise they are set to rwval. Values of all other transitions are set to missing.

If ageval is larger than the largest age in the data frame, a new row will be inserted. Exit transitions are set to 1 for p-variables and to rwval for r-variables. Values of all other transitions are set to missing.

replace

boolean TRUE/FALSE. See option age.

update

boolean TRUE/FALSE. See option age.

rewards

a real number rwval. It determines the rewards value for exit transitions.

Details

mcwr requires that all data points that do not enter matrix calculations be set to missing in order to avoid incorrectly set up data. This rule makes the last (exit) row of the mcwr data frame somewhat tedious to manage. The convenience function mcwr_exit() makes it easier to create or edit the last (exit) row of the data set.

Value

A data.frame, suitable for further processing by mcwr_*() functions.

See Also

Other mcwr: mcwr_check(), mcwr_expectancies(), mcwr_genvars(), mcwr_switch()


[Package mcwr version 1.0.0 Index]