You are here

mxUpdate()

8 posts / 0 new
Last post
Steve's picture
Offline
Joined: 07/30/2009 - 14:03
mxUpdate()

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.

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
Can you clarify: would

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?

tbates's picture
Offline
Joined: 07/31/2009 - 14:25
The simple version - just

The simple version - just grab the new library - seems useful to me. 1 vote for that.

tbates's picture
Offline
Joined: 07/31/2009 - 14:25
mxUpdateOpenMx()

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

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
Again, mxUpdate() can't

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.

tbrick's picture
Offline
Joined: 07/31/2009 - 15:10
I would argue for the simpler

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."

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
Umm. mxUpdate() can't

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.

Steve's picture
Offline
Joined: 07/30/2009 - 14:03
Ah, Windows. Where all files

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?