aphalo / ggpmisc

R package ggpmisc is an extension to ggplot2 and the Grammar of Graphics
https://docs.r4photobiology.info/ggpmisc
94 stars 6 forks source link

How can I get the equation as text? #19

Closed xiucz closed 2 years ago

xiucz commented 2 years ago

Hi, Thanks for your great tool, and I want to know how to extract the equations from stat_poly_eq, not just plot on the graph.

Best, xiucz

aphalo commented 2 years ago

Currently it is not possible. Well, you could use geom_debug() from package 'gginnards' to save the equation, but you would need to create a ggplot to produce the equation text. The package is open source, if you have some idea of R programming, you could have a look at the code in the file stat-poly-eq.R in the definition of function poly_eq_compute_group_fun(), and delete everything that is redundant for your needs.