Learn R Programming

joineR (version 1.0-2)

sample.jointdata: Sample from a jointdata object

Description

Generic function used to sampling a subset of data from an object of class jointdata, with a specific size of number of subjects.

Usage

sample.jointdata(object, size, replace = FALSE)

Arguments

object
an object of class jointdata
size
number of subjects to include in the sampled subset
replace
should sampling be with replacement?

Value

  • The function returns an object of class jointdata, with data only on the subjects sampled.

See Also

sample, jointdata, UniqueVariables.

Examples

Run this code
data(heart.valve)
heart.surv <- UniqueVariables(heart.valve, 
                              var.col=c("fuyrs", "status"), 
                              id.col = "num")
heart.valve.jd <- jointdata(survival = heart.surv, 
                            id.col = "num", 
                            time.col = "time")
sample.jointdata(heart.valve.jd, size = 10)

Run the code above in your browser using DataLab