Has any one else noticed that semPlot no longer works with OpenMx for version 2? I've used it to make path diagrams with versions of OpenMx before 2.0.
Yeah, I've noticed that semPlot is not compatible with OpenMx 2.0 and later. I've contacted the developer, Sacha Epskamp. But the fix does not seem to be high on his priority list. I'm considering making the changes myself and submitting a pull request on his GitHub page ( https://github.com/SachaEpskamp/semPlot ) for him to incorporate my future fix.
The umx package will create a very nice .dot file for RAM models that can be turned into a .pdf with the free graphviz program: http://www.graphviz.org/ . The non-free Mac-only program OmniGraffle can also read in these .dot files and display them nicely.
My best hope is to fix semPlot in the next few months.
I e-mailed Sacha Epskamp yesterday. He said that the version on GitHub will work with OpenMx >=2.0 with the exception that intercepts are not yet supported.
installing source package ‘semPlot’ ...
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘car’
ERROR: lazy loading failed for package ‘semPlot’
restoring previous ‘/home/rick/R/x86_64-pc-linux-gnu-library/3.2/semPlot’
Error: Command failed (1)
In addition: Warning messages:
1: In utils::install.packages(pkgs, repos = repos, type = type, ..., :
installation of package ‘MatrixModels’ had non-zero exit status
2: In utils::install.packages(pkgs, repos = repos, type = type, ..., :
installation of package ‘quantreg’ had non-zero exit status
3: In utils::install.packages(pkgs, repos = repos, type = type, ..., :
installation of package ‘car’ had non-zero exit status
But installation finally succeeded (though semTools was also needed). Problems remained however with running Hunter's script under R 3.2.2 on OS X Yosemite:
> semPaths(factorRun, color =list(lat =rgb(245, 253, 118, maxColorValue =255),
+ man =rgb(155, 253, 175, maxColorValue =255)), mar =c(10, 5, 10, 5))
Error in!object@matrices$M$free : invalid argument type
Hmm ... Are you sure you're running the same example as me? I think you might be trying to run the raw data version of the model: a model with means.
Rabil noted semPlot has problems with intercepts, i.e. means. The only place I could find code that would generate your error message was inside an if() statement that required the means to be non-null. https://github.com/SachaEpskamp/semPlot/blob/5cb2b0303ceb454a270b8c61bfb360e4ca9ae8d1/R/OpenMx.R#L39
Yeah, I've noticed that semPlot is not compatible with OpenMx 2.0 and later. I've contacted the developer, Sacha Epskamp. But the fix does not seem to be high on his priority list. I'm considering making the changes myself and submitting a pull request on his GitHub page ( https://github.com/SachaEpskamp/semPlot ) for him to incorporate my future fix.
The umx package will create a very nice .dot file for RAM models that can be turned into a .pdf with the free graphviz program: http://www.graphviz.org/ . The non-free Mac-only program OmniGraffle can also read in these .dot files and display them nicely.
My best hope is to fix semPlot in the next few months.
I e-mailed Sacha Epskamp yesterday. He said that the version on GitHub will work with OpenMx >=2.0 with the exception that intercepts are not yet supported.
I tried installing on R 3.2.2:
> devtools::install_github("sachaepskamp/semPlot")
but the install failed.
.
.
.
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘car’
ERROR: lazy loading failed for package ‘semPlot’
Error: Command failed (1)
In addition: Warning messages:
1: In utils::install.packages(pkgs, repos = repos, type = type, ..., :
installation of package ‘MatrixModels’ had non-zero exit status
2: In utils::install.packages(pkgs, repos = repos, type = type, ..., :
installation of package ‘quantreg’ had non-zero exit status
3: In utils::install.packages(pkgs, repos = repos, type = type, ..., :
installation of package ‘car’ had non-zero exit status
Cool that Sacha has made the changes! Try
That allowed this to work on my machine.
In my case I needed RCurl and jsonlite as well:
It was also a bit R version dependent. Ok with R 3.2.2 but R 3.1 was messy. semPlot also installed many other things:
Installing 49 packages: acepack, arm, car, coda, corpcor, d3Network, DiagrammeR, doParallel, ellipse, fdrtool, foreach, Formula, ggm, glasso, gridBase, gridExtra, gtools, Hmisc, htmlwidgets, huge, igraph, irlba, iterators, jpeg, latticeExtra, lavaan, lisrelToR, lme4, MatrixModels, NMF, pkgmaker, plyr, png, psych, qgraph, quantreg, Rcpp, registry, rjson, rngtools, rockchalk, scales, sna, SparseM, stringi, tables, visNetwork, XML, xtable
But installation finally succeeded (though semTools was also needed). Problems remained however with running Hunter's script under R 3.2.2 on OS X Yosemite:
and now I am stuck too :(.
Hmm ... Are you sure you're running the same example as me? I think you might be trying to run the raw data version of the model: a model with means.
Rabil noted semPlot has problems with intercepts, i.e. means. The only place I could find code that would generate your error message was inside an if() statement that required the means to be non-null. https://github.com/SachaEpskamp/semPlot/blob/5cb2b0303ceb454a270b8c61bfb360e4ca9ae8d1/R/OpenMx.R#L39
It looks like they're actively tweaking some things specifically as it relates to OpenMx plotting.
https://github.com/SachaEpskamp/semPlot/commits/master
The July and early October versions work, but the ones since October 20th break things.
Do this.
It installs the early October version.