I would like to propose a unified method for users to obtain updates to OpenMx.
mxUpdate()
Without any arguments, this would allow people to load the most current version of OpenMx. If a version number was supplied it could load a specific version if they wanted to roll back an upgrade.
In its simplest form it would look something like
mxUpdate <- function(version=NA) { if(is.na(version)) source('https://openmx.ssri.psu.edu/getOpenMx.R') else source(paste("https://openmx.ssri.psu.edu/get", version, ".R", sep="")) }
This would require keeping the older versions around. But I suspect that would be useful for people. It would also allow us to change the updating mechanism later if we found one that was more convenient to maintain.
Can you clarify: would mxUpdate() just download a specific version of the library, or download and load a specific version of the library? Because the second option is much trickier than the first option. In order to load a specific version of OpenMx, we would need to unload the current loaded version. Which should work in theory, but I don't trust the library unloading mechanism. In addition, there's the complication that mxUpdate() is a part of the OpenMx library. So does the function continue to run when mxUpdate() unloads itself from the namespace?
The simple version - just grab the new library - seems useful to me. 1 vote for that.
if this is still live, i'd vote too for calling the function
mxUpdateOpenMx()
to avoid confusion with update()
but I guess the package might move usefully move to CRAN with 1.0 out?
Also, I'd note that students I help have had errors with using
source('http://openmx.psyc.virginia.edu/getOpenMx.R')
and they don't understand what it does (because the code is hidden
As all this is, is:
repos <- c('http://openmx.psyc.virginia.edu/packages/')
install.packages(pkgs=c('OpenMx'), repos=repos)
I recommend showing people that, or even (if it doesn't push some >80 char panic button :-)
install.packages(pkgs=c('OpenMx'), repos='http://openmx.psyc.virginia.edu/packages/')
Again, mxUpdate() can't install the new package if the OpenMx library is already loaded. If source('installation url'), then users should be noticing the error in their script before they run the remainder of their script. We could have annoying pop-ups appear in the case of errors, although I vote against that idea.
I would argue for the simpler method. Download the version of the library (and install it into R's package areas). Then put up a warning or other obvious message that says "Please restart R and reload the OpenMx library."
Umm. mxUpdate() can't install the new package if the OpenMx library is already loaded. Which brings us back to the question of whether mxUpdate() continues to run if it unloads the OpenMx library.
Ah, Windows. Where all files are open streams. Phooey. Well, it would work for everyone else.
I wonder if there is something Windows-specific that we can do to get around their limitation?