Metrics
Metrics

Reputation: 15458

pscl package of R

I was running the xyplot of presidential elections in the pscl package and got the error

data(presidentialElections)
library(lattice)
xyplot(demVote ~ year | state,
       panel=panel.lines,
       ylab="Democratic Vote for President (percent)",
       xlab="Year",
       data=presidentialElections,
       scales=list(y=list(cex=.6),x=list(cex=.35)),
       strip=strip.custom(par.strip.text=list(cex=.6)))

Error:
Error in recordGraphics(drawGrob(x), list(x = x), getNamespace("grid")) :
  invalid graphics state

I am a new user to R and would appreciate if anyone can help me to fix the error.

Upvotes: 4

Views: 3811

Answers (2)

Anton Tarasenko
Anton Tarasenko

Reputation: 8455

Try dev.off() and then re-run the same code.

Upvotes: 3

Riley
Riley

Reputation: 23

I personally use tinn r to program in R and find it very useful, you can close/open R easily and still send command lines in. (you can even DL different versions of R to load for different packages)

Upvotes: 0

Related Questions