checkData {lavaSearch2}R Documentation

Check that Validity of the Dataset

Description

Check whether the dataset can be used to fit the lvm object.

Usage

checkData(object, data, trace)

## S3 method for class 'lvm'
checkData(object, data, trace = TRUE)

Arguments

object

a lvm object.

data

[data.frame] the dataset used to obtain the object.

trace

[logical] when TRUE, the outcome of the check will be displayed.

Value

Invisible TRUE or FALSE.

Examples

m <- lvm()
regression(m) <- c(y1,y2,y3)~u
regression(m) <- u~x
latent(m) <- ~u

d <- lava::sim(m,1e2)

try(checkData(m, data = d)) # return an error

checkData(m, data = d[,-4])

try(checkData(m, data = d[,-(3:4)])) # return an error


[Package lavaSearch2 version 2.0.3 Index]