Cannot read data? Error in .cleanHashData

92 views
Skip to first unread message

christop...@gmail.com

unread,
Oct 26, 2020, 7:21:42 AM10/26/20
to MplusAutomation
After updating to 0.8 I have a problem with reading data. (I did not have a problem with these data a week ago, but I'm not be sure the error is a result of the update.)

This the error message:
 Error in .cleanHashData(df = df, keepCols = keepCols, imputed = imputed) : 
  missing(keepCols) || is.character(keepCols) || is.numeric(keepCols) ||  .... is not TRUE 

Previously, I have learned to convert labelled data and tibbles to ordinary data frames,  and to remove any character variables to make Mplus read data without errors.

I'm not able to find any problem:
class(mydata) gives "data.frame"
map(mydata, class) gives consistently "numeric" for all columns/variables.

Any help?

christop...@gmail.com

unread,
Oct 26, 2020, 6:30:19 PM10/26/20
to MplusAutomation
I was able to try the old version of MplusAutomation (V0.7-3, on a different computer). No error there, using the same data and the same code that gave a data error with MplusAutomation 0.8.

Maybe others can report if they should get the same error with the new mplusModeler(). Since a very simple regression model with the "cars" data from R gave no error, I'm not yet confident there is a bug in mplusModeler() in MplusAutomation 0.8.

Regards, 
Christopher 

christop...@gmail.com

unread,
Oct 27, 2020, 5:15:53 AM10/27/20
to MplusAutomation
Case solved for me even on the original computer by downgrading to MplusAutomation 0.7-3. If anyone experiences similar problems, they might try using 0.7-3:

remove.packages("MplusAutomation")
require(devtools)
install_version("MplusAutomation", version = "0.7-3", repos = "http://cran.us.r-project.org")

library(MplusAutomation)

Some details of the data causing problems in 0.8 are described in the first post. The data file is an ordinary Stata data file (I do som data manipulaton in Stata because Stata's advanced features for manipulating a single data frame). 

Then:
data_in_R <- sjlabelled::read_stata("old_data.dta")

# Generate data for Mplus with no labels
data_in_R <- sjlabelled::remove_all_labels(data_in_R)

(I believe that haven::read_stata() once gave me more problems than sjlabelled, so I stick to the sjlabelled package.)
That's it from me. Thanks a lot for a wonderful package!

Christopher


michael.hallquist

unread,
Oct 27, 2020, 10:57:43 AM10/27/20
to MplusAutomation
Hi Christopher,

It would be great if you could post a fully reproducible example as an issue on Github: https://github.com/michaelhallquist/MplusAutomation/issues. Without having the details, it's hard to tell what has changed and I wouldn't recommend downgrading the package version as a solution (given how many fixes are included in v0.8).

Thanks,
Michael

christop...@gmail.com

unread,
Oct 27, 2020, 11:53:54 AM10/27/20
to MplusAutomation
Thanks. I will try to do so in a few days. No later than the weekend, I hope. 

Best,
Christopher

christop...@gmail.com

unread,
Oct 29, 2020, 4:35:38 AM10/29/20
to MplusAutomation
Hi Michael

I have been playing with the data and MplusAutomation 0.8 a few hours and cannot consistently get an error when I try to minimise data and model. So, I am still not sure I encountered a bug in v0.8. I do have the problem that the original, complex model ran fine in v0.7-3 but not in v0.8, but I would want to replicate the problem with a simple model before claiming a bug is to blame. I will keep 0.8 on my laptop and report to GitHub if I feel I can give an informative report. I will keep 0.7-3 on the desktop and once in a while run all my current models on the laptop to see whether I am able to identify the problem. No news will be good news, I guess. No news would indicate that I cannot replicate the error with a simple model. If I understand what part of a complex model might have caused the problem, I'll report back. 

While I have your attention: I feel lavaan has gotten very good and is in active development. So I would like to use lavaan as a basis for SEM, switching to Mplus whenever I need some advanced features that lavaan does not provide. I realised you wrote the mplus2lavaan and mplus2lavaan.modelSyntax functions in lavaan. One nice idea, I think, would be to have a function that converts lavaan syntax into Mplus syntax. Unfortunately,  don't think I can do that work, I'm a lousy programmer. 

Christopher

christop...@gmail.com

unread,
Oct 29, 2020, 5:24:57 PM10/29/20
to MplusAutomation
Michale: Done. As far as I can see, it seems to be a problem with update()?

christop...@gmail.com

unread,
Mar 11, 2021, 12:10:26 PM3/11/21
to MplusAutomation
This issue resulted in a bug report on Github, due to a bug in update()

https://github.com/michaelhallquist/MplusAutomation/issues/130

This case was closed 17 days ago on Github.
But no change has been made to MplusAutomation so far, am I right?

Best,
Chris

Reply all
Reply to author
Forward
0 new messages