[R] Error in family$family : $ operator is invalid for atomic vectors

2009-10-11 Thread romunov
Dear List, I'm having problem with an exercise from The R book (M.J. Crawley) on page 567. Here is the entire code upto the point where I get an error. data(UCBAdmissions) x - aperm(UCBAdmissions, c(2, 1, 3)) names(dimnames(x)) - c(Sex, Admit?, Department) ftable(x) fourfoldplot(x, margin = 2)

Re: [R] Error in family$family : $ operator is invalid for atomic vectors

2009-10-11 Thread Barry Rowlingson
On Sun, Oct 11, 2009 at 4:54 PM, romunov romu...@gmail.com wrote: Dear List, I'm having problem with an exercise from The R book (M.J. Crawley) on page 567. Here is the entire code upto the point where I get an error. data(UCBAdmissions) x - aperm(UCBAdmissions, c(2, 1, 3))

Re: [R] Error in family$family : $ operator is invalid for atomic vectors

2009-10-11 Thread Jorge Ivan Velez
Hi Romain, It works for me: model1 - glm(as.vector(x) ~dept*sex*admit,poisson) model1 Call: glm(formula = as.vector(x) ~ dept * sex * admit, family = poisson) Coefficients: (Intercept) dept2 dept3 dept4 dept5 6.23832

Re: [R] Error in family$family : $ operator is invalid for atomic vectors

2009-10-11 Thread romunov
Thank you Jorge and Barry for your input. I've fiddled around a bit and as a result, am even more confused. If I start R console via Notepad++ (I use Npp2R) and execute the model1, it goes through just fine. Here is the sessionInfo() for this working session: sessionInfo() R version 2.9.2

Re: [R] Error in family$family : $ operator is invalid for atomic vectors

2009-10-11 Thread Sundar Dorai-Raj
Check to see if you have an old workspace being loaded. You might have an object called 'family' which you might need to remove. --sundar On Oct 11, 2009 12:15 PM, romunov romu...@gmail.com wrote: Thank you Jorge and Barry for your input. I've fiddled around a bit and as a result, am even more

Re: [R] Error in family$family : $ operator is invalid for atomic vectors

2009-10-11 Thread romunov
Hello Sundar, I checked the ls() and it was full of something (something that I should have removed long ago but was not diligent enough). I have cleared the list (via rm(list=ls()) and the glm function works fine now. Cheers, Roman On Sun, Oct 11, 2009 at 9:21 PM, Sundar Dorai-Raj