! Using an auto-discovered, cached token.
To suppress this message, modify your code or options to clearly consent to
the use of a cached token.
See gargle's "Non-interactive auth" vignette for more details:
<https://gargle.r-lib.org/articles/non-interactive-auth.html>
ℹ The googlesheets4 package is using a cached token for
'7576425921@untrm.edu.pe'.
✔ Reading from "LA MOLINA 2014 POTATO WUE (FB)".
✔ Range ''fb''.
library(ggplot2)ggplot(fb, aes(x =factor(geno), y = lfa, fill =factor(riego))) +geom_boxplot() +labs(x ="genotipo" , y ="LFA" , fill ="riego") +theme_minimal() +theme(axis.text.x =element_text(angle =45, hjust =1)) +ggtitle("Boxplot de LFA por genotipo y riego")
6 Comparación De Medias
library(agricolae) library(tidyverse)# comparación de medias para el factor genocat("Comparación de medias para geno:\n")
Comparación de medias para geno:
tukey_geno <-HSD.test(modelo, "geno", group =TRUE)print(tukey_geno)
library(ggplot2)# Crear el gráfico de barras con ggplot2ggplot(mc, aes(x = variedad, y = lfa, fill = riego)) +geom_bar(stat ="identity", position =position_dodge(width =0.9)) +# Barras agrupadas por riegogeom_text(aes(label = groups), position =position_dodge(0.9), vjust =-0.5) +# Etiquetas de los grupos sobre las barraslabs(title ="Producción por Variedad y Riego", x ="Variedad", y ="LFA") +# Etiquetas de los ejes y títuloscale_fill_manual(values =c("irrigado"="tomato", "sequia"="turquoise3")) +# Colores personalizados para riegotheme_minimal() +# Tema minimalistatheme(axis.text.x =element_text(angle =45, hjust =1)) # Rotar etiquetas del eje X
7 comparacion de medias: emmeans
library(emmeans)
Welcome to emmeans.
Caution: You lose important information if you filter this package's results.
See '? untidy'
mc <-emmeans(modelo,~ riego*geno)mc <-emmeans(modelo, ~ riego|geno) mc <-emmeans(modelo, ~ riego|geno) %>%as.data.frame()mc
anova_resultado <- aov(% DE COHESIÓN ~ factor(TRATAMIENTO), data = datos)
10 Realizar la prueba de Tukey HSD
tukey_resultado <- TukeyHSD(anova_resultado)
11 Ver los resultados de Tukey
summary(tukey_resultado)
12 Gráfico de caja para la variable “% DE COHESIÓN” por “TRATAMIENTO”
ggplot(datos, aes(x = factor(TRATAMIENTO), y = % DE COHESIÓN)) + geom_boxplot(fill = “skyblue”, color = “black”) + labs(title = “Comparación de Medias: % DE COHESIÓN por TRATAMIENTO”, x = “Tratamiento”, y = “% DE COHESIÓN”) + theme_minimal()
13 Gráficos de ggplot2
13.1 Gráficos en data cruda
13.1.1 Box plot
fb %>%ggplot(data = ., aes(x = geno, y = hi, fill = riego)) +geom_boxplot()+labs(x ="Genotipos" , y ="Índice de cosecha" , fill ="Tratamiento" , title ="Eficiencia de uso de agua en Papa" , subtitle ="Índice de cosecha" , caption ="n = 150",) +theme_classic() +theme(plot.title =element_text(hjust =0.5)) +theme(text =element_text(family ="serif"))
13.1.2 Scater plot
fb %>%ggplot(data = ., aes(x = twue, y = hi, color = riego)) +geom_point() +geom_smooth() +labs(x ="Genotipos" , y ="Índice de cosecha" , fill ="Tratamiento" , title ="Eficiencia de uso de agua en Papa" , subtitle ="Índice de cosecha" , caption ="n = 150",) +theme_bw() +theme(plot.title =element_text(hjust =0.5)) +theme(text =element_text(family ="serif"))
`geom_smooth()` using method = 'loess' and formula = 'y ~ x'