Re: [R] ggplot2 stat_smooth formula different units

2020-11-11 Thread David Winsemius
On 11/11/20 2:11 PM, Marcelo Laia wrote: Hi, I am running these approaches: Model 1 ggplot( dat , aes(x=DAP, y=Altura, color=as.factor(Espacamento) )) + geom_point(size=0.5) + stat_smooth(method = "lm", formula = y ~ x + I(x^2), size = 1) + facet_grid(Espacame

Re: [R] ggplot2 stat_smooth formula different units

2020-11-11 Thread Marcelo Laia
Hi Rui, You are very welcome! On 11/11/20 at 11:10, Rui Barradas wrote: > > dput(head(dat, 20)) > structure(list(Bloco = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), Espacamento = c("3 x 1", "3 x 1", "3 x 1", "3 x 1", "3 x 1", "3 x 1", "3 x 1", "3 x 1",

Re: [R] ggplot2 stat_smooth formula different units

2020-11-11 Thread Rui Barradas
Hello, Try removing I() from I(log(y)). But it's hard to say without a reproducible example, please post the output of dput(dat) or, if dat is big, the output of dput(head(dat, 20)) Hope this helps, Rui Barradas Às 22:11 de 11/11/20, Marcelo Laia escreveu: Hi, I am running these approa

[R] ggplot2 stat_smooth formula different units

2020-11-11 Thread Marcelo Laia
Hi, I am running these approaches: Model 1 ggplot( dat , aes(x=DAP, y=Altura, color=as.factor(Espacamento) )) + geom_point(size=0.5) + stat_smooth(method = "lm", formula = y ~ x + I(x^2), size = 1) + facet_grid(Espacamento ~ Clone) + theme(legend.position="none")