Hi, I am new to R and am trying to run some spatial analysis using SpatialEpi package. Here is part of my code:
geo<-latlong2grid(cbind(MBPolygon@data$X,MBPolygon@data$Y)) population<-tapply(mydata$population,mydata$PHRAS4,sum) cases<-tapply(mydata$case, mydata$PHRAS4,sum) expected.cases<-mydata$expected and then I run: output<-bayes_cluster(expected.cases, cases, population, geo, MBPolygon, max.prop, k, shape, rate, J, pi0, n.sim.imp, n.sim.prior, n.sim.post) which is a function for MCMC. I got this message: " Error message as.vector(data): no method for coercing this S4 class to a vector" I ran the author's code and got the same message. I'm guessing there maybe some issue with my R environment. Many people online mentioned namespace, but no idea how to fix it. Please help. xibiao [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.