trying to put OpenMxGUI into a package, i ran into a problem with the object from summary(MxModel). for some reason, the object is of class "summary.mxmodel" when all of OpenMxGUI is input using source(). in the package, however, the object is of class "table."
this is what i get when i read in the code using "source" and run the model:
> head(summary(thisOMxModel)$parameters)
name matrix row col Estimate Std.Error
1 sqrtStdE 1 1 1.9426018 0.05663194
2 sqrtStdE 2 2 2.1226024 0.08699889
3 sqrtStdE 3 3 1.8922519 0.06716601
4 sqrtStdE 4 4 2.1911936 0.05992282
5 sqrtStdE 5 5 1.9405663 0.05366479
6 RE 1 2 0.4240149 0.05843882
> test <- summary(thisOMxModel)
> class(test)
[1] "summary.mxmodel"
> getClass("summary.mxmodel")
Error in getClass("summary.mxmodel") :
"summary.mxmodel" is not a defined class
this is what i get when the following code is executed in a package:
CODE:
x <- summary(thisOMxModel)$parameters
testProj <<- summary(thisOMxModel)
classTestProj <<- class(testProj)
RESULTS:
Error in summary(thisOMxModel)$parameters :
$ operator is invalid for atomic vectors
> classTestProj
[1] "table"
> testProj
Length Class Mode
1 MxModel S4
>
in the NAMESPACE file for OpenMx, "summary.mxmodel" is treated as an S3 method. the package seems to be treating it as S4. anything funky here?
greg