subset_id {polle}R Documentation

Subset Policy Data on ID

Description

subset_id returns a policy data object containing the given IDs.

Usage

subset_id(object, id, preserve_action_set = TRUE)

Arguments

object

Object of class policy_data.

id

character vectors of IDs.

preserve_action_set

If TRUE, the action sets must be preserved.

Value

Object of class policy_data.

Examples

library("polle")
### Single stage:
d <- sim_single_stage(5e2, seed=1)
# constructing policy_data object:
pd <- policy_data(d, action="A", covariates=list("Z", "B", "L"), utility="U")
pd

# getting the observation IDs:
get_id(pd)[1:10]

# subsetting on IDs:
pdsub <- subset_id(pd, id = 250:500)
pdsub
get_id(pdsub)[1:10]

[Package polle version 1.4 Index]