ggfortify - 使用自动绘图为线性模型上使用的 ggfortify 对象生成交互式绘图
问题描述
我正在尝试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'
更新
好的,所以我可以通过首先指定要强化的感兴趣的地块来解决这个问题。虽然,我不知道为什么现在错误消失了。
lm.plot = autoplot(Model, label.size = 3, which = 1:2) + theme_bw()
但是现在autoplotly
没有正确显示QQ情节。
解决方案
根据文档,shareY
参数告诉函数是否在子图中共享 y 轴。
尝试这个:
autoplotly(lm.plot, shareY = FALSE)
推荐阅读
- python-3.x - TypeError: 不支持的操作数类型 /: 'float' 和 'method' 在尝试查找数据框中 2 列的比率时
- python - 如何在 pyhton:multiprocessing 的进程中终止所有进程的异常
- r - 将 Origina Destinations 的 GIS 数据重新排列为每个点一行
- c - 为什么从 arr 读取时我将所有名称放在一行中?
- postgresql - EFCore 查询以按产品搜索词获取每个供应商的产品数量
- r - CPI 与 R 的通货膨胀率
- html - 仅一个单词的字母间距不正确
- java - 确保十进制数的字符串 repr 始终为 n 个字符长
- json - 将json数组转换为scala列表
- delphi - Delphi TFontDialog - 如何针对高 Dpi 进行缩放?