Open rjmorris opened 8 years ago
Seems like your data structure is a case I've never seen so far. I doubt that it would help to run it on Linux. Could you send me a portion of R code that would setup such a structure so that I can replicate the problem here on my developer machine? Otherwise I will have a hard time to track the problem down.
Thanks for taking a look at this. The following code should produce an object with that structure:
install.packages("survey")
library(survey)
set.seed(237686251)
## Create a sample dataset.
data = data.frame(wt = runif(100, 1, 1000))
data$stratum = 1:10
data$stratum = sort(data$stratum)
data$cluster = 1:2
data$group = factor(sample(4, size = nrow(data), replace = TRUE))
## Create the survey "design" object.
design = svydesign(
data = data,
strata = ~stratum,
id = ~cluster,
weights = ~wt,
nest = TRUE)
## Compute the frequency distribution for the 'group' variable.
distrib = svymean(
x = ~group,
design = design)
## Examine the resulting object.
print(distrib)
str(distrib)
I'm trying to use pyRserve to retrieve objects returned by functions in R's
survey
package. However, for some objects I get the following error:I can successfully retrieve other
survey
objects from my R program, so I don't think it's an error in how I'm writing the code. Here's an example of the structure of one of the objects I'm having trouble with:I can work around the error by using accessor functions provided by
survey
to return simpler objects which do work with pyRserve. For example, I can use thecoef
function to get just the coefficients stored in thesvystat
object. The structure of that object in R looks like:And when I pull this in through pyRserve, the resulting Python object looks like:
I'm using pyRserve 0.8.4 on Windows 7 with R 3.1.2. I could test on Linux if you think it would make a difference. I'm happy to provide additional information if necessary.