Link Documentation directly to Example Scripts/Data

3 replies [Last post]
Hermine's picture
Offline
Joined: 07/31/2009

I would like to link all the OpenMx scripts directly to the documentation, but don't know where they physically reside, and can't find them from the website.

Ideally, if a user clicks on a (linked) script, it should open immediately in their R application so it can be run with just two clicks (assuming the user has R installed). Could/should this be done and if so, how?

tbates's picture
Offline
Joined: 07/31/2009
All the demo files are

All the demo files are available right on the user's machine, so one thing to do might be to give a clickable link which opens in a browser window, and along side it the R command to open the file locally?

something like:

fileToOpen = system.file("demo", "BivariateSaturated_PathCov.R", package="OpenMx")
system(paste('open', fileToOpen))

We might want to tell the server to treat .R files as text so they open in the browser. Not sure which would be what most people want: download, or open in browser.

The Dutch repository has both, I guess: opens the code in a new window, and has a .zip link which downloads the data and script.

mspiegel's picture
Offline
Joined: 07/31/2009
Umm what? If they have the

Umm what? If they have the OpenMx library installed, they can run a demo by typing demo(FooBarBaz). That's the point of the demos. Otherwise they can download the file and source the file in R. Any call to system is both (a) tricky to make sure that different variations are included for all three supported platforms (OS X, Linux, and Windows), and (b) a potential security risk for shell injection attacks (http://en.wikipedia.org/wiki/Code_injection#Shell_injection)

mspiegel's picture
Offline
Joined: 07/31/2009
One way to reach a file in

One way to reach a file in the repository is through a URL that looks something like this: http://openmx.psyc.virginia.edu/repoview/1/trunk/demo/BivariateCorrelati.... But I'll defer to Jeff on what is the best way to set up the links.