mode_function <- function(v) {
uniqv <- unique(v)
uniqv[which.max(tabulate(match(v, uniqv)))]
}
cultivo %>%
summarise(media = round(mean(`Cobertura (%)`),2),
desv = round(sd(`Cobertura (%)`),2),
vari = round(var(`Cobertura (%)`),2),
coef = round((100* desv/media),2)) %>%
datatable()
cultivo %>%
ggplot(aes(x = 0, y = `Cobertura (%)`, color = "cyan")) +
geom_boxplot()+
theme(legend.position = 'none')+
geom_violin(color = 'black', alpha = 0.3)+
stat_summary(fun = mean, color = 'red')
cultivo %>%
summarise(media = round(mean(`Altura (cm)`),2),
desv = round(sd(`Altura (cm)`),2),
vari = round(var(`Altura (cm)`),2),
coef = round((100* desv/media),2)) %>%
datatable()
cultivo %>%
ggplot(aes(x = 0, y = `Altura (cm)`, color = "cyan")) +
geom_boxplot()+
theme(legend.position = 'none')+
geom_violin(color = 'black', alpha = 0.3)+
stat_summary(fun = mean, color = 'red')
cultivo %>%
summarise(moda_fen = mode_function(BBCH),
moda_fis = mode_function(FISIOLOGIA),
moda_est = mode_function(`Establecimiento (%)`),
moda_flM = mode_function(`No de flores masculinas`),
moda_flF = mode_function(`No flores femeninas`),
moda_fru = mode_function(`No de frutos`),
moda_hojas = mode_function(`No de hojas`)
)%>%
datatable(rownames = FALSE,
extensions = c('Buttons'),
options = list(
dom = 'Brftip',
buttons = c('excel', 'pdf')))
enfermedades %>%
group_by(ENFERMEDAD) %>%
summarise(moda_incidencia = mode_function(Incidencia),
media_severidad = round(mean(`Severidad (%)`),2),
desv_severidad = round(sd(`Severidad (%)`),2),
var_severidad = round(var(`Severidad (%)`),2),
coef_severidad = round((100 * desv_severidad/media_severidad),2)
) %>%
datatable()
enfermedades %>%
filter(ENFERMEDAD == 'Mildeo velloso') %>%
ggplot(aes(x = 0,y = `Severidad (%)`))+
geom_boxplot(color = 'cyan')+
geom_violin(alpha = 0.3)+
stat_summary(fun = mean, color = 'red')
## Warning: Removed 1 rows containing missing values (geom_segment).
plagas %>%
group_by(Plaga, Especie) %>%
summarise(media = round(mean(`Densidad (Indiv/p. muest) Promedio`, na.rm = TRUE),2),
desv = round(sd(`Densidad (Indiv/p. muest) Promedio`, na.rm = TRUE),2),
vari = round(var(`Densidad (Indiv/p. muest) Promedio`, na.rm = TRUE),2),
coef = round((100* desv/media), 2)
)%>%
datatable()
## `summarise()` has grouped output by 'Plaga'. You can override using the `.groups` argument.
plagas %>%
filter(Plaga == 'Trips') %>%
ggplot(aes(x = 0,y = `Densidad (Indiv/p. muest) Promedio`, color = Especie))+
geom_boxplot()+
geom_violin(alpha = 0.3)+
stat_summary(fun = mean, color = 'red', cex = 0.3)+
facet_wrap(~ Especie)+
theme(legend.position = 'none')
plagas %>%
filter(Plaga == 'Diptera') %>%
ggplot(aes(x = 0,y = `Densidad (Indiv/p. muest) Promedio`))+
geom_boxplot(color = 'gold')+
geom_violin(alpha = 0.3)+
stat_summary(fun = mean, color = 'red', cex = 0.3)+
theme(legend.position = 'none')
malezas %>%
group_by(MALEZA) %>%
summarise(media_co = round(mean(Cobertura, na.rm = TRUE), 2),
desv_co = round(sd(Cobertura, na.rm = TRUE), 2),
var_co = round(var(Cobertura, na.rm = TRUE), 2),
coef_co = round((100*desv_co/media_co),2),
media_indi = round(mean(`No individuos`, na.rm = TRUE), 2),
desv_indi = round(sd(`No individuos`, na.rm = TRUE), 2),
var_indi = round(var(`No individuos`, na.rm = TRUE), 2),
coef_indi = round((100*desv_indi/media_indi),2),
moda_etapa = mode_function(`Etapa Fenológica`)
) %>%
datatable()
malezas %>%
group_by(MALEZA) %>%
ggplot(aes(x = 0, y = Cobertura, fill = MALEZA))+
geom_boxplot()+
geom_violin(alpha = 0.3)+
stat_summary(fun = mean, color = 'red', cex = 0.3)+
facet_wrap(~ MALEZA)+
theme(legend.position = 'none')
malezas %>%
group_by(MALEZA) %>%
ggplot(aes(x = 0, y = `No individuos`, fill = MALEZA))+
geom_boxplot()+
geom_violin(alpha = 0.3)+
stat_summary(fun = mean, color = 'red', cex = 0.3)+
facet_wrap(~ MALEZA)+
theme(legend.position = 'none')