gpt4 book ai didi

r - 散点图矩阵 - 错误 : Viewport 'plot_01.panel.1.1.off.vp' was not found"

转载 作者:行者123 更新时间:2023-12-01 21:24:21 29 4
gpt4 key购买 nike

当我想创建散点图矩阵时,出现错误

Error in grid.Call.graphics(C_downviewport, name$name, strict) : Viewport 'plot_01.panel.1.1.off.vp' was not found".

我该如何解决这个问题?

varNum <- function(x){
val <- 1:ncol(x)
names(val) <- colnames(x)
return(val)
}

varNum(house)
Bedroom SquareFeet Followers VisitingTime TotalPrice UnitPrice
1 2 3 4 5 6
District Location
7 8

house1 <- house[,c(7,1:6)]
offDiag <- function(x,y,...){
panel.grid(h = -1,v = -1,...)
panel.hexbinplot(x,y,xbins = 15,...,border = gray(.7),
trans = function(x)x^.5)
# panel.loess(x , y, ..., lwd=2,col='red')
}

onDiag <- function(x, ...){
yrng <- current.panel.limits()$ylim
d <- density(x, na.rm = TRUE)
d$y <- with(d, yrng[1] + 0.95 * diff(yrng) * y / max(y) )
panel.lines(d,col = rgb(.83,.66,1),lwd = 2)
diag.panel.splom(x, ...)
}

splom(house1,as.matrix = TRUE,
xlab = '',main = "Beijing Housing Variables",
pscale = 0, varname.cex = 0.8,axis.text.cex = 0.6,
axis.text.col = "purple",axis.text.font = 2,
axis.line.tck = .5,
panel = offDiag,
diag.panel = onDiag
)

Error in grid.Call.graphics(C_downviewport, name$name, strict) : Viewport 'plot_01.panel.1.1.off.vp' was not found

最佳答案

尝试安装椭圆包。您不需要将其作为库加载,只需安装它即可。

install.packages("ellipse")

关于r - 散点图矩阵 - 错误 : Viewport 'plot_01.panel.1.1.off.vp' was not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50299338/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com