Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Taller numero 3
2022
#Librerias requeridas
library(ggplot2)
library(tidyverse)
## Conflicts tidyverse_conflicts()
## x dplyr::filter() masks
stats::filter() ## x dplyr::lag()
masks stats::lag()
library(dplyr)
library(patchwork)
colores<-c("#BCD2EE",
"#A2B5CD",
"#6E7B8B")
#base de datos
1
## $ SOM : num 2.96 2.96 1.02 1.02 1.06 ...
## $ PH : num 7.34 7.34 7.28 7.28 6.36 ...
## $ YIELD : num 3.8 4.45 1.8 3 2.8 3 3.9 4.5 3.8 4.5 ...
2
maizemean<- read.csv2("Maizemean.csv",
header=TRUE) str(maizemean)
Histograma
Figura 1
Rendimiento del Maíz
0.3
Frecuencia
0.2
0.1
0.0
3
Densidad
Figura 2
Rendimiento del Maíz en el año 2018
0.20
0.15
Densidad
0.10
0.05
0.00
Área
4
ggplot(maizemean, aes(x= Year , y= PromedioYIELD )) + geom_area(colour="#BCD2EE", fill="#6E7B8B",
alpha= 0.25) + theme_minimal() + labs(title = "Figura 3",
x= "Año",
y=" Rendimiento promedio del
maíz (Mg ha-1)") +
theme(text=element_text(family ="serif", size=12))
Figura 3
4
Rendimiento promedio del maíz
3
(Mg ha−1)
Barras
5
columna<- p1+p2
columna + plot_annotation(title = "Figura 4")&
theme(plot.title = element_text( family = "serif", size = 13))
Figura 4
40000 Landrace
kg N ha−1
20000
Hybrid
0
Hybrid Landrace 0 2500 5000 7500 10000 12500
kg P2O5 ha−1
Boxplot
6
Figura 5
Landrace
Tipo de labranza
Hybrid
Violin
7
Figura 6
12
8
Rendimiento del maíz
Regresión
8
Figura 7
2000
1500
Elevación (m)
1000
500
library(GGally)
9
ggplot2:: theme_set ( ggplot2:: theme_bw ())
ggpairs(maizeselect1, columns = 1:10,
mapping=aes(alpha=0.5),
lower = list(continuous = wrap("points", color = "#3C8200", alpha =
0.25), combo = wrap("box", fill= "#1F733D", alpha = 0.3),
discrete = wrap("facetbar", color = "orange", alpha = 0.3) ),
diag = list(continuous = wrap("densityDiag", fill= "#1F733D", alpha =
0.5)))
YIELD System Nitroge hosphoru otassium Slope Clay CEC SOM PH
0.20 nCorr: Corr:
Corr: Corr: Corr: Corr: Corr: Corr:
D
YIEL
1
0.10
05
5
0.00 .536** .321** .252** 0.382 −0.109 0.119 −0.073 0.055
Hybrid
CEC
2 Corr:
10
4 .240**
3
SOM
2
1
8
7
PH
6
5
0.02.5.07.150.H0ybLraidndrac0e1020030000 501001500 255075 0 102030 1020304050 1020304050 1 2 3 4 5
6 7 8
#Trivariado
10
Figura 10
Hybrid Landrace
10.0
Rendimiento del maíz (Mg ha−1)
7.5
System
5.0 Hybrid
Landrace
2.5
0.0
1 2 3 4 1 2 3 4
Materia orgánica (%)
11