r - 在 ggplot 中显示 y~log(x) 函数的 R2 和 p 值
问题描述
我想ggplot
用对数回归做一个,并想显示 R2 和 p 值。我试过stat_cor
了,但它只显示线性回归的 R2 和 p 值。我试图将 "formula=y~log(x)" 合并到stat_cor
,但 sais 未知参数:公式。我是否必须使用不同的功能才能做到这一点?
ggplot(data = Data,aes(x=Carbon_per,y=Pyrite_per,col=Ecosystem,shape=Ecosystem)) +
geom_smooth(method='lm', formula=y~log(x))+
geom_point() +
stat_cor(aes(label = paste(..rr.label.., ..p.label.., sep = "~`,`~")))
干杯,格洛丽亚
解决方案
推荐阅读
- python - 如何在列中为每个值附加时间片?
- excel - 使用数组时如何解决运行时错误 6
- excel - Excel 在 if 语句中使用 2 个单元格
- asp.net - 在 ASP.NET 网站项目中使用 64 位引用 - 设计时问题
- mysql - 嵌入式 Debezium。试图查看偏移文件的格式。不工作
- git - 不小心推送了一个没有更改的现有分支,现在 Bitbucket 不允许我创建拉取请求或撤消
- javascript - 如果没有操作,我是否需要使用 HTML 表单标签?
- jquery - 为什么我无法在这里触发“更改”事件?
- c++ - 有没有办法让函数成为参数?
- android - 单击recyclerview的特定行时如何显示图像