的pscl包我跑的總統選舉中pscl包xyplot並得到了錯誤[R
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
我是新用戶,以R和希望如果有人能幫助我修正這個錯誤。
適合我。我討厭建議一些骨頭,但你有沒有嘗試重新啓動你的R會議? (你是否有機會在Rstudio上運行它?)您可能會遇到麻煩,因爲圖形非常大,R可能無法爲邊距等分配空間。 –
對我也適用,也適用於RStudio。你使用什麼版本的格和R? – EDi
非常感謝。它在我重新啓動時起作用。是的,我正在使用R studio。這種類型的問題在R studio中很常見? – Metrics