Boriss at gmx.net
2008-Oct-18 19:04 UTC
[R] Fehler in x$terms : $ operator is invalid for atomic vectors
Dear All I try to use your R package MCMCpack and I have encountered the following problem: The following code works fine: library(MCMCpack) line <- list(X = c(-2,-1,0,1,2), Y = c(1,3,3,3,5)) posterior1 <- MCMCregress(X~Y, data=line) summary(posterior1) But as long as I try the following lines library(MCMCpack) line <- list(X = c(-2,-1,0,1,2), Y = c(1,3,3,3,5)) posterior2 <- MCMCregress(paste(?X?,?Y?,sep=?~?), data = line) summary(posterior2) I get the following error message:> library(MCMCpack)> line <- list(X = c(-2,-1,0,1,2), Y = c(1,3,3,3,5))> posterior2 <- MCMCregress(paste("X","Y",sep="~"), data = line)Fehler in x$terms : $ operator is invalid for atomic vectors> summary(posterior2)Fehler in summary(posterior2) : objekt "posterior" nicht gefunden>This is seems to me a bit strange as the following line with the command lm(), which I believe use a similar structure, works fine: X = c(-2,-1,0,1,2) Y = c(1,3,3,3,5) lm(paste("X","Y", sep="~")) lm(X~Y) Thank you Borissssssssssssssssssssss --
Ben Bolker
2008-Oct-18 19:51 UTC
[R] Fehler in x$terms : $ operator is invalid for atomic vectors
<Boriss <at> gmx.net> writes:> > Dear All > > I try to use your R package MCMCpack and I have > encountered the following problem: >You should (a) address this to the maintainers of the MCMCpack package (see help(package="MCMCpack") for contact info) and (b) indicate the results of sessionInfo(), which will give information on what version of R, MCMCpack, operating system, etc. you use. good luck, Ben Bolker