Background
While analysing some data in a SEM model one can list the indicators that are the most influent to the model fit. This is done with the command modind from the lavaan project. I can filter it to show only the first few. The command looks like:
head(mod_ind[order(mod_ind$mi, decreasing=TRUE), ], 4)
The output would normally look like:
lhs op rhs group mi mi.scaled epc sepc.lv sepc.all
5760 var12 ~ g 1 0 0 0 0 0
7740 var2 ~ g 1 0 0 0 0 0
5562 var35 ~ g 1 0 0 0 0 0
8598 var7 ~ g 1 0 0 0 0 0
Question
- How to parse/pipe the name of these variables (var12, var2, var35, var7) into a vector of strings?