output="text" problem with fitMeasures()

Skip to first unread message

John Jamison

May 17, 2020, 6:48:46 AM5/17/20
to lavaan
I'm testing out the output="text" introduced with 0.6.5. I really like the "pretty printing". I'm using the output to create an object ( model.test<-fitMeasures(test.1,output="text") ), and exporting that object using the "rio" package ( rio::export(model.test), "name.xlsx" )

This is working great for paramaterEstimates and standardizedSolution, but not with fitMeasures. For fit measures, I only get the second column (i.e. the values) but not the first column (i.e. the labels). The "pretty printing" version shows up when I run the object in R, but the exported object in excel is lacking the first column. Since the output shows up prettily in R, it may be a problem between lavaan and rio, but it's weird that the problem doesn't exist for paramaterEstimates or standardizedSolution, which both look "pretty".

As a workaround, I'm using tidy(fitMeasures(model.name)), but this uses the shortened and hard to read labels (i.e. it's not "pretty").

Terrence Jorgensen

May 18, 2020, 5:16:31 AM5/18/20
to lavaan
I'm not familiar with rio, but check str(model.test) to see if the names are not a column in a matrix / data.frame, but instead are rownames(model.test), in which case maybe an additional argument in rio::export() is needed to preserve those row names as a column in the spreadsheet.

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Yves Rosseel

May 26, 2020, 12:23:51 PM5/26/20
to lav...@googlegroups.com
This will simply not work. output="text" is pretty printing on the
screen, but it does not 'return' the formatted text.

Reply all
Reply to author
0 new messages