Learn R Programming

simr (version 1.0.0)

getData: Get an object's data.

Description

Get the data associated with a model object.

Usage

getData(object)

getData(object) <- value

Arguments

object
a fitted model object (e.g. an object of class merMod or lm).
value
a new data.frame to replace the old one. The new data will be stored in the newData attribute.

Value

  • A data.frame with the required data.

Details

Looks for data in the following order:
  1. The object'snewDataattribute, if it has been set bysimr.
The data argument of getCall(object), in the environment of formula(object).

Examples

Run this code
lm1 <- lmer(y ~ x + (1|g), data=simdata)
X <- getData(lm1)

Run the code above in your browser using DataLab