Learn R Programming

SimDesign (version 1.13)

subset.SimDesign: Subset method for SimDesign objects

Description

subset.SimDesign is a default method for subsetting a data.frame of class SimDesign. This is a modification of the base R subset command to maintain the extra attributes produced during a simulation.

Usage

# S3 method for SimDesign
subset(x, ...)

Arguments

x

A data.frame object, of class SimDesign

...

Further arguments to be passed to subset

Value

A data.frame/SimDesign class object.

References

Sigal, M. J., & Chalmers, R. P. (2016). Play it again: Teaching statistics with Monte Carlo simulation. Journal of Statistics Education, 24(3), 136-156. 10.1080/10691898.2016.1246953

See Also

SimDesign

Examples

Run this code
# NOT RUN {
data("BF_sim")
x <- subset(BF_sim, select = 1:6)
attributes(x)
head(x)

x1 <- subset(BF_sim, select = c(1,2,4,5,10))
attributes(x1)

x2 <- subset(BF_sim, select = var_ratio:alpha.05.Jacknife)
attributes(x2)

x3 <- subset(BF_sim, var_ratio == 1)
dim(BF_sim)
dim(x3)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab