[R-es] Dibujar un gráfico con 4 terms - ggeffects + plot

Jaume Tormo j@utorb|@ @end|ng |rom gm@||@com
Mar Oct 20 18:24:44 CEST 2020


Hola eRRer using s,

He creado un modelo mixto (adjunto) con lme4
He dibujado la predicción usando:
df <- ggpredict(m.glob.pre.anu
                    , terms = c("pre", "area_m2", "sum.vs.win")
                    )
plot(df)
Luego he arreglado el gráfico usando:
df <- ggpredict(m.glob.pre.anu
                    , terms = c("pre", "area_m2", "sum.vs.win")
                    )
plot(df)+
labs(title =  "Predicted number of annuals" # falla al posar 4 terms en el
df
         ,x = "MAP"
         ,y = "Proportion of annuals"
         ) +
scale_x_continuous(breaks = c(-2,0,2)
                               , labels= etiquetas
                                )  +
labs(color="Area")
Pero me interesa más el modelo con 4 terms que sería:
df <- ggpredict(m.glob.pre.anu
                    , terms = c("pre", "area_m2", "sum.vs.win", "data_type")
                    )
plot(df)
Hasta aquí funciona todo.
Pero si intento hacer los arreglos p.e.:
plot(df)+
labs(title =  "Predicted number of annuals"
         ,x = "MAP"
         ,y = "Proportion of annuals"
         )
Me da el siguiente error:
Error in plot(df) + labs(title = "Predicted number of annuals", x = "MAP",
 :
  non-numeric argument to binary operator
Creo que el error se debe a que en el modelo ahora hay 4 terms en lugar de
3 ¿Puede ser?
¿Se os ocurre qué puede estar pasando? ¿Sabéis cómo puedo especificar los
títulos, leyendas, etc. de otra forma?

Muchas gracias de antemano.

-- 
Dr. Jaume Tormo.
Area of Ecology
Department of Agrarian and Environmental Sciences
Technological College. Agri-food and Environment
University of Zaragoza, Spain
0034 974292678
https://es.linkedin.com/in/jaumetormo
https://acercad.wordpress.com/

------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20201020/d3862921/attachment-0001.html>

------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: modelo.RData
Type: application/octet-stream
Size: 130468 bytes
Desc: no disponible
URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20201020/d3862921/attachment-0001.obj>


Más información sobre la lista de distribución R-help-es