could not find functions?

Posted on
No user picture. cvanhulle Joined: 05/07/2010

I'm trying to use a couple of nifty functions that I cribbed from a script from the Twin Workshop. When I try to use
formatOutputMatrices or tableFitStatistics I get an error message saying R "could not find function".

Suggestions?

Thanks,
Carol

Replied on Tue, 09/21/2010 - 13:02
Picture of user. mspiegel Joined: Jul 31, 2009

One option is to use the following line in your script:
source("http://www.vipbg.vcu.edu/~vipbg/Tc24/GenEpiHelperFunctions.R")

Another option is to see if the mxCompare() function does what you want. See ?mxCompare. That function is maintained by the development team. I'm not sure whether the Gen Epi Helper Functions are maintained.

Replied on Tue, 09/21/2010 - 13:07
Picture of user. tbates Joined: Jul 31, 2009

Hi Carol,
Those functions and others are in a helper file (i.e., not part of OpenMx) called "GenEpiHelperFunctions.R"
To access them you need to
1. Have a copy of the file. Yyou can grab a copy here for example: http://ibg.colorado.edu/cdrom2010/bartels/MultivariateTwinAnalysis

2. load it into R using the source() function.
source("GenEpiHelperFunctions.R")

For this to work the helper file needs to reside in your current working directory (which you can see by typing
getwd() and can set with setwd() (or cmd-D in OS X)

Replied on Tue, 09/21/2010 - 13:18
Picture of user. tbates Joined: Jul 31, 2009

In reply to by cvanhulle

I think they are the same (you could compare them). Really the advice differs only in whether you need to be online to pull th file in over a URL.
With un-supported files like that, though they are a great convenience, you should look through each function to ensure you know what is happening behind the scenes, and ensure it is what you want/expect.

best,
t