You are here

How do I add a demo script to an OpenMx directory?

5 posts / 0 new
Last post
trinewa's picture
Offline
Joined: 11/30/2009 - 06:35
How do I add a demo script to an OpenMx directory?

Hi
I woulld like to share a demo script to the following directory:
https://openmx.ssri.psu.edu/repoview/1/trunk/demo

The Wiki says where to put the file, but not technically how to add the file to the directory.
Any help?

mspiegel's picture
Offline
Joined: 07/31/2009 - 15:24
The demos are stored in our

The demos are stored in our subversion source code repository. There are a few steps necessary in order to include a new script in the demo directory:

(1) Make sure there are no commands in the script that are specific to your environment. So eliminate any calls to setwd(). Also data cannot be read using read.table() or similar functions. Replace them with calls to data(), and we'll place the dataset in the OpenMx library as well. Make sure the dataset can be released to the public. The script should not access the internet using source('http://'), we assume all demos work without an internet connection.

(2) Add error checking to the end of the script. See ?omxCheckEnough for the omxCheck* family of functions. See (http://openmx.psyc.virginia.edu/repoview/1/trunk/demo/DefinitionMeans_PathRaw.R) for an example of error checking.

We can commit the file into the repository once the changes have been made.

trinewa's picture
Offline
Joined: 11/30/2009 - 06:35
Must demo scripts always be

Must demo scripts always be entered together with data? Are there any options for faking data that work with moderators/interaction effects?

tbates's picture
Offline
Joined: 07/31/2009 - 14:25
The script could generate its

The script could generate its own data as long as the seed etc was set so that it had known-in-advance answers.

tbates's picture
Offline
Joined: 07/31/2009 - 14:25
Also you can often reuse one

Also you can often reuse one of the datasets already in the package, or perhaps in the base package.
There are now quite a few:

data(package="OpenMx")