Hi R-users,
I have the following problem with CrossTable function within ?gmodels? package: the output of the function (format ?spss? and asresid=T) can not be stored within another object.
For example:
library(gmodels)
data(infert, package = "datasets")
CrossTable(infert$education, infert$induced)->aa # the function prints everything ok on the screen
aa # works just fine
$t
y
x 0 1 2
0-5yrs 4 2 6
6-11yrs 78 27 15
12+ yrs 61 39 16
?????.
But when I call
CrossTable(infert$education, infert$induced, asresid=TRUE, format="SPSS")->aaa # the function prints everything ok on the screen
aaa # now I have a problem
NULL
Why is aaa object NULL? Should it be NULL? I suspect it has something to do with the SPSS-format option but I?m not sure
The reason I want it stored in an object, is to use the adjusted standardized residuals in a LateX document with xtable.
Does anyone have a solution, please?
Thank you very much and have a great day ahead!