check_lavaan_uses inspects the model data frame produced by check_lavaan_df according to the arguments you specify. If it cannot find any rows in the data frame that match all of the arguments and corresponding values, the function will fail.

check_lavaan_uses(state, incorrect_msg, append = TRUE, ...)

Arguments

state

state to start from (has to be the state produced by check_lavaan_df)

incorrect_msg

feedback message in case the specified columns and values were not found in the lavaan data frame.

append

whether or not to append the incorrect_msg message to earlier messages that describe the object.

...

named args are columns of lavaanify output, and their values are used to subset that output.

Details

To see which arguments you can pass to the ellipsis argument, use lavaan::lavaanify on a lavaan model. Examples of arguments are lhs, op, and rhs, among others.

Examples

# NOT RUN {
# example 1
# lavaan::lavaanify(model) produces df with 3 rows
model <- 'a ~ x1'

# sct
ex() %>%
  check_object("model") %>%
  check_lavaan_df() %>%
  check_lavaan_uses(lhs = 'a', op = '~', rhs = 'x1')

# example 2
# lavaan::lavaanify(model) produces df with 6 rows
model <- 'a ~ x1 + x3'

# sct
ex() %>%
  check_object("model") %>%
  check_lavaan_df() %>%
  check_lavaan_uses(lhs = 'a', op = '~', rhs = 'x1')

# sct
ex() %>%
  check_object("model") %>%
  check_lavaan_df() %>%
  check_lavaan_uses(lhs = 'a', op = '~', rhs = 'x3')

# }