我试图根据基于这个ggfortify的多元回归模型为数据对象生成一个交互式的绘图。以下是我迄今所做的工作。如何使用ggfortify为此autoplotly对象生成交互式绘图?
library(ggfortify)
library(autoplotly)
# Construct a simple multivariate regression model
# So it's something like this SWE ~ Mean.Z + Intensity.mean
Model = lm(formula = SWE ~ Mean.Z + Intensity.mean, data = df.mean.swe)
# Plot the model
lm.plot = autoplot(Model, label.size = 3) + theme_bw()
# Interactive
autoplotly(lm.plot)
Error in unique.default(x) :
unimplemented type 'expression' in 'HashTableSetup'更新
好的,所以我可以通过首先指定fortify.Though感兴趣的图来解决这个问题,我不知道为什么错误现在消失了。
lm.plot = autoplot(Model, label.size = 3, which = 1:2) + theme_bw()

但是现在autoplotly没有正确地显示Q-Q图。

发布于 2021-05-06 06:34:51
根据文档,shareY参数告诉函数是否在子图之间共享y轴。
试试这个:
autoplotly(lm.plot, shareY = FALSE)https://stackoverflow.com/questions/67067767
复制相似问题