当前位置:网站首页>How to add a regression equation to a plot in R

How to add a regression equation to a plot in R

2022-06-26 02:45:00 Mrrunsen

Usually , You may want to add regression equations to R In the drawing in , As shown below :

、、 Insert picture description here

Fortunately, , Use ggplot2 and ggpubr The functions in the package can easily do this .

This tutorial provides a step-by-step example , Shows how to use the functions in these packages to add regression equations to R In the drawing in .

The first 1 Step : Create data
First , Let's create some fake data to process :、

set.seed(1)

#create data frame
df <- data.frame(x &
原网站

版权声明
本文为[Mrrunsen]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206260130504034.html