mxUpdate()

Posted on
Picture of user. Steve Joined: 07/30/2009
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('http://openmx.psyc.virginia.edu/getOpenMx.R')
    else source(paste("http://openmx.psyc.virginia.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.

Replied on Fri, 04/23/2010 - 09:47
Picture of user. mspiegel Joined: 07/31/2009

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?
Replied on Sun, 05/22/2011 - 07:03
Picture of user. tbates Joined: 07/31/2009

In reply to by tbates

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/')

Replied on Sun, 05/22/2011 - 09:38
Picture of user. mspiegel Joined: 07/31/2009

In reply to by tbates

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.
Replied on Fri, 04/23/2010 - 11:22
Picture of user. tbrick Joined: 07/31/2009

In reply to by mspiegel

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."
Replied on Sun, 04/25/2010 - 17:26
Picture of user. Steve Joined: 07/30/2009

In reply to by mspiegel

Ah, Windows. Where all files are open streams. Phooey. Well, it would work for everyone else.

> library(OpenMx)
> updateMx <- function(){source('http://openmx.psyc.virginia.edu/getOpenMx.R')}
> updateMx()
trying URL 'http://openmx.psyc.virginia.edu/packages/bin/macosx/leopard/contrib/2.10/OpenMx_0.3.0-1217.tgz'
Content type 'application/x-gzip' length 1340571 bytes (1.3 Mb)
opened URL
==================================================
downloaded 1.3 Mb


The downloaded packages are in
	/var/folders/8x/8x41+HxKHXyI-EAZ7Yi3S++++TI/-Tmp-//Rtmp46fIUb/downloaded_packages

I wonder if there is something Windows-specific that we can do to get around their limitation?