# sample input
test <- "MODEL:
mpg ON wt hp;
wt WITH hp
"
# check and return
cat(parseMplus(test), fill=TRUE)
# add missing semicolons and return
cat(parseMplus(test, TRUE), fill=TRUE)
test <- "MODEL:
mpg cyl disp hp drat wt qsec vs am gear PWITH cyl disp hp drat wt qsec vs am gear carb;
"
cat(parseMplus(test))
Run the code above in your browser using DataLab