Thank you so much for both of you!
I am trying to run Structural Equation Modeling with Lavaan. Thus, I tried this code below. But when I used "=~" symbol, it doesn't work. Could you let me know how to handle this?
practice <- as.formula(paste("=~", paste0("aaqii", 1:8, collapse = "+")))
#> Error in str2lang(x): <text>:1:1: unexpected '='
#> 1: =
#> ^
I might be wrong, but from what I remember lavaan needs a string not a formula. The string can contain many formulae... so @jrkrideau is probably right. You can then add f1 before the =~