# Punto 1.1 Genere una muestra de tamaño 120 de la distribución normal con media 5, desviación estándar 0.85. Use solo dos números decimales (rnorm())
set.seed(2005)
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
x<-round(rnorm(120,5,0.85),2)
x
## [1] 5.82 6.08 5.40 5.44 4.65 5.06 4.76 5.21 5.82 3.80 4.31 5.08 4.76 4.45 5.06
## [16] 3.33 5.87 5.46 3.79 4.53 5.59 5.80 4.77 5.20 4.50 3.64 5.00 4.97 5.50 5.20
## [31] 4.48 4.31 4.66 5.87 4.94 2.81 5.29 6.16 4.07 5.34 4.48 4.39 4.23 4.40 4.87
## [46] 4.18 4.35 5.65 4.68 4.74 6.62 5.02 6.52 5.28 4.71 3.68 3.69 4.85 4.09 5.60
## [61] 4.04 5.10 4.35 5.11 4.30 4.13 2.79 6.10 4.77 4.63 5.70 5.40 5.48 4.49 5.48
## [76] 5.83 5.70 5.19 5.04 5.37 4.34 5.62 3.38 4.73 5.63 6.12 3.78 4.26 4.11 5.24
## [91] 4.24 4.95 5.19 3.94 4.60 5.50 5.68 5.57 4.73 4.98 5.79 4.35 5.36 5.14 5.02
## [106] 4.43 5.27 4.70 5.45 5.84 6.24 5.57 4.89 5.65 4.11 5.72 5.25 4.04 5.21 5.51
# Punto 1.2 Genere una muestra de tamaño 120 de la distribución binomial con parámetros 0.8 (probabilidad) y 20 (ensayos independientes) (rbinom())
y<- rbinom(120,20,0.8)
y
## [1] 16 17 14 17 16 17 15 16 19 12 17 16 13 18 14 16 15 16 15 17 16 14 18 18 13
## [26] 17 14 16 18 16 13 17 16 17 15 15 18 15 16 15 15 12 16 18 16 19 15 17 13 19
## [51] 14 18 17 16 19 14 16 17 13 17 19 16 15 18 17 15 14 18 17 16 16 18 13 16 18
## [76] 13 15 16 18 17 16 17 18 18 13 15 18 18 11 15 17 18 19 16 13 18 16 16 16 18
## [101] 15 17 16 19 17 14 17 16 16 18 17 17 17 15 18 13 18 17 17 17
# Punto 1.3 Genere una muestra de tamaño 120 de la distribución Poisson con parámetro 10.5 (media) (rpois())
z<- rpois(120,10.5)
z
## [1] 10 8 11 12 14 16 15 9 9 8 6 14 12 13 11 8 4 9 11 12 11 7 16 6 9
## [26] 12 9 11 10 14 10 11 12 10 10 6 9 11 12 10 12 11 5 7 14 11 3 9 7 13
## [51] 12 11 17 5 13 15 9 11 11 6 6 15 18 5 11 10 16 14 10 7 15 7 9 11 10
## [76] 11 12 10 17 11 17 10 8 13 8 11 11 17 9 12 9 16 9 13 12 7 9 7 15 9
## [101] 10 11 16 13 13 9 10 14 14 9 9 13 13 2 6 12 12 12 13 12
# Punto 1.4 Genere una muestra con reemplazo de tamaño 120 de una secuencia de 300 números (sample.int())
R<- sample.int(300,120,replace = TRUE)
R
## [1] 5 186 231 103 196 21 225 39 149 167 189 123 155 212 282 213 20 196
## [19] 75 106 177 201 5 265 110 155 245 33 101 78 106 171 147 277 93 203
## [37] 238 119 277 279 239 194 206 74 114 45 186 285 75 34 10 100 285 89
## [55] 107 76 78 41 73 281 170 274 223 212 95 47 223 171 78 277 210 153
## [73] 226 244 253 294 131 128 138 210 31 119 237 79 176 9 114 58 248 249
## [91] 245 183 193 75 62 253 98 79 265 259 288 110 1 84 110 200 8 161
## [109] 216 28 195 210 74 143 258 273 225 280 102 153
# Punto 1.5 Usando la librería purrr genere una muestra de la distribución de Bernoulli de tamaño 120 y parámetro 0.75 (probabilidad) (rbernoulli()) y cambie el FALSE por (ausente) y el TRUE por (presente).
library(purrr)
rb<- rbernoulli(120,0.75)
rb <- ifelse(rb == "TRUE", "Presente","Ausente")
rb
## [1] "Presente" "Ausente" "Presente" "Presente" "Ausente" "Presente"
## [7] "Ausente" "Presente" "Presente" "Presente" "Presente" "Presente"
## [13] "Presente" "Presente" "Presente" "Presente" "Presente" "Presente"
## [19] "Ausente" "Presente" "Presente" "Presente" "Presente" "Presente"
## [25] "Presente" "Presente" "Ausente" "Ausente" "Presente" "Presente"
## [31] "Presente" "Presente" "Presente" "Presente" "Presente" "Ausente"
## [37] "Presente" "Presente" "Presente" "Ausente" "Ausente" "Presente"
## [43] "Presente" "Ausente" "Presente" "Presente" "Presente" "Presente"
## [49] "Presente" "Presente" "Presente" "Ausente" "Presente" "Presente"
## [55] "Presente" "Presente" "Ausente" "Presente" "Ausente" "Presente"
## [61] "Presente" "Presente" "Presente" "Ausente" "Presente" "Presente"
## [67] "Presente" "Presente" "Presente" "Presente" "Presente" "Presente"
## [73] "Ausente" "Presente" "Presente" "Ausente" "Presente" "Presente"
## [79] "Presente" "Ausente" "Presente" "Ausente" "Presente" "Presente"
## [85] "Presente" "Presente" "Presente" "Ausente" "Ausente" "Presente"
## [91] "Presente" "Presente" "Presente" "Presente" "Presente" "Presente"
## [97] "Presente" "Presente" "Presente" "Presente" "Presente" "Presente"
## [103] "Presente" "Presente" "Ausente" "Presente" "Presente" "Presente"
## [109] "Presente" "Ausente" "Presente" "Presente" "Presente" "Ausente"
## [115] "Ausente" "Ausente" "Ausente" "Presente" "Presente" "Presente"
# punto 1.6 Genere tres niveles de un factor, cada uno con 40 datos y etiquételos con (S) para identificar la planta (sana), (PA) para las plantas parcialmente afectadas y (MA) para las muy afectadas. Use la función (gl()).
enf<- gl(3,40,length = 120,labels = c("S","PA", "MA"))
enf
## [1] S S S S S S S S S S S S S S S S S S S S S S S S S
## [26] S S S S S S S S S S S S S S S PA PA PA PA PA PA PA PA PA PA
## [51] PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA
## [76] PA PA PA PA PA MA MA MA MA MA MA MA MA MA MA MA MA MA MA MA MA MA MA MA MA
## [101] MA MA MA MA MA MA MA MA MA MA MA MA MA MA MA MA MA MA MA MA
## Levels: S PA MA
# Punto 1.7 Genere dos niveles de un factor usando la distribución uniforme con parámetros 0 y 1.2, ponga para cada dato a generar de los 120 la condición de si el número generado es menor a 0.5, los etiquetamos como (FO) para asociarlo a fertilización orgánica, de lo contrario, use (FI) para asociarlo a fertilización inorgánica. Use la función (runif()). Si lo desea use la función (ifelse()) o (if else()) para condicionar.
Fert<- runif(120,0,1.2)
Fert<-(ifelse(Fert<0.5,"FO","FI"))
Fert
## [1] "FI" "FI" "FI" "FI" "FI" "FO" "FI" "FO" "FO" "FO" "FO" "FO" "FO" "FO" "FI"
## [16] "FO" "FI" "FI" "FI" "FO" "FO" "FI" "FI" "FI" "FO" "FI" "FI" "FI" "FI" "FO"
## [31] "FO" "FO" "FO" "FI" "FI" "FO" "FI" "FO" "FI" "FO" "FO" "FI" "FI" "FO" "FI"
## [46] "FO" "FO" "FI" "FI" "FO" "FI" "FI" "FI" "FI" "FO" "FI" "FO" "FI" "FO" "FI"
## [61] "FO" "FI" "FI" "FI" "FI" "FO" "FO" "FI" "FO" "FO" "FO" "FI" "FI" "FI" "FI"
## [76] "FI" "FO" "FI" "FI" "FI" "FI" "FI" "FI" "FO" "FI" "FI" "FI" "FI" "FO" "FO"
## [91] "FI" "FI" "FI" "FI" "FO" "FO" "FI" "FO" "FI" "FI" "FI" "FI" "FO" "FO" "FI"
## [106] "FO" "FI" "FI" "FI" "FI" "FI" "FO" "FO" "FO" "FI" "FO" "FI" "FI" "FI" "FI"
# Punto 1.8 Construya un marco de datos (data.frame()) o una tableta (tibble()) con todas las variables antes generadas y asigne respectivamente los nombres de variable: Biomasa(gramos), Flores.r (conteo de flores en tres ramas), Flores.d (conteo de flores desprendidas), Hojas.d (conteo de hojas desprendidas), Plaga , Estatus y Fertilización. Revise del objeto creado, su dimensión (dim()), su estructura con (str()) o (glimpse()), la clase (class()), los nombres en las variables (names()), la presencia de faltantes (is.na())
library(dplyr)
df1=data.frame(x,y,z,R,rb,enf,Fert)
df2<-rename(df1,Biomasa_gramos=x,Flores.r=y,Flores.d=z,Hojas.d=R,Plaga=rb,Estatus=enf,Fertilizacion=Fert)
df2
## Biomasa_gramos Flores.r Flores.d Hojas.d Plaga Estatus Fertilizacion
## 1 5.82 16 10 5 Presente S FI
## 2 6.08 17 8 186 Ausente S FI
## 3 5.40 14 11 231 Presente S FI
## 4 5.44 17 12 103 Presente S FI
## 5 4.65 16 14 196 Ausente S FI
## 6 5.06 17 16 21 Presente S FO
## 7 4.76 15 15 225 Ausente S FI
## 8 5.21 16 9 39 Presente S FO
## 9 5.82 19 9 149 Presente S FO
## 10 3.80 12 8 167 Presente S FO
## 11 4.31 17 6 189 Presente S FO
## 12 5.08 16 14 123 Presente S FO
## 13 4.76 13 12 155 Presente S FO
## 14 4.45 18 13 212 Presente S FO
## 15 5.06 14 11 282 Presente S FI
## 16 3.33 16 8 213 Presente S FO
## 17 5.87 15 4 20 Presente S FI
## 18 5.46 16 9 196 Presente S FI
## 19 3.79 15 11 75 Ausente S FI
## 20 4.53 17 12 106 Presente S FO
## 21 5.59 16 11 177 Presente S FO
## 22 5.80 14 7 201 Presente S FI
## 23 4.77 18 16 5 Presente S FI
## 24 5.20 18 6 265 Presente S FI
## 25 4.50 13 9 110 Presente S FO
## 26 3.64 17 12 155 Presente S FI
## 27 5.00 14 9 245 Ausente S FI
## 28 4.97 16 11 33 Ausente S FI
## 29 5.50 18 10 101 Presente S FI
## 30 5.20 16 14 78 Presente S FO
## 31 4.48 13 10 106 Presente S FO
## 32 4.31 17 11 171 Presente S FO
## 33 4.66 16 12 147 Presente S FO
## 34 5.87 17 10 277 Presente S FI
## 35 4.94 15 10 93 Presente S FI
## 36 2.81 15 6 203 Ausente S FO
## 37 5.29 18 9 238 Presente S FI
## 38 6.16 15 11 119 Presente S FO
## 39 4.07 16 12 277 Presente S FI
## 40 5.34 15 10 279 Ausente S FO
## 41 4.48 15 12 239 Ausente PA FO
## 42 4.39 12 11 194 Presente PA FI
## 43 4.23 16 5 206 Presente PA FI
## 44 4.40 18 7 74 Ausente PA FO
## 45 4.87 16 14 114 Presente PA FI
## 46 4.18 19 11 45 Presente PA FO
## 47 4.35 15 3 186 Presente PA FO
## 48 5.65 17 9 285 Presente PA FI
## 49 4.68 13 7 75 Presente PA FI
## 50 4.74 19 13 34 Presente PA FO
## 51 6.62 14 12 10 Presente PA FI
## 52 5.02 18 11 100 Ausente PA FI
## 53 6.52 17 17 285 Presente PA FI
## 54 5.28 16 5 89 Presente PA FI
## 55 4.71 19 13 107 Presente PA FO
## 56 3.68 14 15 76 Presente PA FI
## 57 3.69 16 9 78 Ausente PA FO
## 58 4.85 17 11 41 Presente PA FI
## 59 4.09 13 11 73 Ausente PA FO
## 60 5.60 17 6 281 Presente PA FI
## 61 4.04 19 6 170 Presente PA FO
## 62 5.10 16 15 274 Presente PA FI
## 63 4.35 15 18 223 Presente PA FI
## 64 5.11 18 5 212 Ausente PA FI
## 65 4.30 17 11 95 Presente PA FI
## 66 4.13 15 10 47 Presente PA FO
## 67 2.79 14 16 223 Presente PA FO
## 68 6.10 18 14 171 Presente PA FI
## 69 4.77 17 10 78 Presente PA FO
## 70 4.63 16 7 277 Presente PA FO
## 71 5.70 16 15 210 Presente PA FO
## 72 5.40 18 7 153 Presente PA FI
## 73 5.48 13 9 226 Ausente PA FI
## 74 4.49 16 11 244 Presente PA FI
## 75 5.48 18 10 253 Presente PA FI
## 76 5.83 13 11 294 Ausente PA FI
## 77 5.70 15 12 131 Presente PA FO
## 78 5.19 16 10 128 Presente PA FI
## 79 5.04 18 17 138 Presente PA FI
## 80 5.37 17 11 210 Ausente PA FI
## 81 4.34 16 17 31 Presente MA FI
## 82 5.62 17 10 119 Ausente MA FI
## 83 3.38 18 8 237 Presente MA FI
## 84 4.73 18 13 79 Presente MA FO
## 85 5.63 13 8 176 Presente MA FI
## 86 6.12 15 11 9 Presente MA FI
## 87 3.78 18 11 114 Presente MA FI
## 88 4.26 18 17 58 Ausente MA FI
## 89 4.11 11 9 248 Ausente MA FO
## 90 5.24 15 12 249 Presente MA FO
## 91 4.24 17 9 245 Presente MA FI
## 92 4.95 18 16 183 Presente MA FI
## 93 5.19 19 9 193 Presente MA FI
## 94 3.94 16 13 75 Presente MA FI
## 95 4.60 13 12 62 Presente MA FO
## 96 5.50 18 7 253 Presente MA FO
## 97 5.68 16 9 98 Presente MA FI
## 98 5.57 16 7 79 Presente MA FO
## 99 4.73 16 15 265 Presente MA FI
## 100 4.98 18 9 259 Presente MA FI
## 101 5.79 15 10 288 Presente MA FI
## 102 4.35 17 11 110 Presente MA FI
## 103 5.36 16 16 1 Presente MA FO
## 104 5.14 19 13 84 Presente MA FO
## 105 5.02 17 13 110 Ausente MA FI
## 106 4.43 14 9 200 Presente MA FO
## 107 5.27 17 10 8 Presente MA FI
## 108 4.70 16 14 161 Presente MA FI
## 109 5.45 16 14 216 Presente MA FI
## 110 5.84 18 9 28 Ausente MA FI
## 111 6.24 17 9 195 Presente MA FI
## 112 5.57 17 13 210 Presente MA FO
## 113 4.89 17 13 74 Presente MA FO
## 114 5.65 15 2 143 Ausente MA FO
## 115 4.11 18 6 258 Ausente MA FI
## 116 5.72 13 12 273 Ausente MA FO
## 117 5.25 18 12 225 Ausente MA FI
## 118 4.04 17 12 280 Presente MA FI
## 119 5.21 17 13 102 Presente MA FI
## 120 5.51 17 12 153 Presente MA FI
dim(df1)
## [1] 120 7
str(df1)
## 'data.frame': 120 obs. of 7 variables:
## $ x : num 5.82 6.08 5.4 5.44 4.65 5.06 4.76 5.21 5.82 3.8 ...
## $ y : int 16 17 14 17 16 17 15 16 19 12 ...
## $ z : int 10 8 11 12 14 16 15 9 9 8 ...
## $ R : int 5 186 231 103 196 21 225 39 149 167 ...
## $ rb : chr "Presente" "Ausente" "Presente" "Presente" ...
## $ enf : Factor w/ 3 levels "S","PA","MA": 1 1 1 1 1 1 1 1 1 1 ...
## $ Fert: chr "FI" "FI" "FI" "FI" ...
class(df1)
## [1] "data.frame"
names(df1)
## [1] "x" "y" "z" "R" "rb" "enf" "Fert"
table(is.na(df1))
##
## FALSE
## 840
length(df1)
## [1] 7
# Punto 1.9 Usando la información del punto anterior, Seleccione un subconjunto (el 75 % de las filas de todas las columnas) de todo el marco de datos o tableta. Use la función (samplen()) y asigne un valor faltante NA a dos variables cuantitativas cualesquiera del conjunto de datos muestreado. LLame tib.c al data.frame completo y tic.i al pequeño. Con estos dos data.frames resuelva los puntos que se presentas en los ejercicios posteriores.
tib.c=df2 #tabla completa
tib.c
## Biomasa_gramos Flores.r Flores.d Hojas.d Plaga Estatus Fertilizacion
## 1 5.82 16 10 5 Presente S FI
## 2 6.08 17 8 186 Ausente S FI
## 3 5.40 14 11 231 Presente S FI
## 4 5.44 17 12 103 Presente S FI
## 5 4.65 16 14 196 Ausente S FI
## 6 5.06 17 16 21 Presente S FO
## 7 4.76 15 15 225 Ausente S FI
## 8 5.21 16 9 39 Presente S FO
## 9 5.82 19 9 149 Presente S FO
## 10 3.80 12 8 167 Presente S FO
## 11 4.31 17 6 189 Presente S FO
## 12 5.08 16 14 123 Presente S FO
## 13 4.76 13 12 155 Presente S FO
## 14 4.45 18 13 212 Presente S FO
## 15 5.06 14 11 282 Presente S FI
## 16 3.33 16 8 213 Presente S FO
## 17 5.87 15 4 20 Presente S FI
## 18 5.46 16 9 196 Presente S FI
## 19 3.79 15 11 75 Ausente S FI
## 20 4.53 17 12 106 Presente S FO
## 21 5.59 16 11 177 Presente S FO
## 22 5.80 14 7 201 Presente S FI
## 23 4.77 18 16 5 Presente S FI
## 24 5.20 18 6 265 Presente S FI
## 25 4.50 13 9 110 Presente S FO
## 26 3.64 17 12 155 Presente S FI
## 27 5.00 14 9 245 Ausente S FI
## 28 4.97 16 11 33 Ausente S FI
## 29 5.50 18 10 101 Presente S FI
## 30 5.20 16 14 78 Presente S FO
## 31 4.48 13 10 106 Presente S FO
## 32 4.31 17 11 171 Presente S FO
## 33 4.66 16 12 147 Presente S FO
## 34 5.87 17 10 277 Presente S FI
## 35 4.94 15 10 93 Presente S FI
## 36 2.81 15 6 203 Ausente S FO
## 37 5.29 18 9 238 Presente S FI
## 38 6.16 15 11 119 Presente S FO
## 39 4.07 16 12 277 Presente S FI
## 40 5.34 15 10 279 Ausente S FO
## 41 4.48 15 12 239 Ausente PA FO
## 42 4.39 12 11 194 Presente PA FI
## 43 4.23 16 5 206 Presente PA FI
## 44 4.40 18 7 74 Ausente PA FO
## 45 4.87 16 14 114 Presente PA FI
## 46 4.18 19 11 45 Presente PA FO
## 47 4.35 15 3 186 Presente PA FO
## 48 5.65 17 9 285 Presente PA FI
## 49 4.68 13 7 75 Presente PA FI
## 50 4.74 19 13 34 Presente PA FO
## 51 6.62 14 12 10 Presente PA FI
## 52 5.02 18 11 100 Ausente PA FI
## 53 6.52 17 17 285 Presente PA FI
## 54 5.28 16 5 89 Presente PA FI
## 55 4.71 19 13 107 Presente PA FO
## 56 3.68 14 15 76 Presente PA FI
## 57 3.69 16 9 78 Ausente PA FO
## 58 4.85 17 11 41 Presente PA FI
## 59 4.09 13 11 73 Ausente PA FO
## 60 5.60 17 6 281 Presente PA FI
## 61 4.04 19 6 170 Presente PA FO
## 62 5.10 16 15 274 Presente PA FI
## 63 4.35 15 18 223 Presente PA FI
## 64 5.11 18 5 212 Ausente PA FI
## 65 4.30 17 11 95 Presente PA FI
## 66 4.13 15 10 47 Presente PA FO
## 67 2.79 14 16 223 Presente PA FO
## 68 6.10 18 14 171 Presente PA FI
## 69 4.77 17 10 78 Presente PA FO
## 70 4.63 16 7 277 Presente PA FO
## 71 5.70 16 15 210 Presente PA FO
## 72 5.40 18 7 153 Presente PA FI
## 73 5.48 13 9 226 Ausente PA FI
## 74 4.49 16 11 244 Presente PA FI
## 75 5.48 18 10 253 Presente PA FI
## 76 5.83 13 11 294 Ausente PA FI
## 77 5.70 15 12 131 Presente PA FO
## 78 5.19 16 10 128 Presente PA FI
## 79 5.04 18 17 138 Presente PA FI
## 80 5.37 17 11 210 Ausente PA FI
## 81 4.34 16 17 31 Presente MA FI
## 82 5.62 17 10 119 Ausente MA FI
## 83 3.38 18 8 237 Presente MA FI
## 84 4.73 18 13 79 Presente MA FO
## 85 5.63 13 8 176 Presente MA FI
## 86 6.12 15 11 9 Presente MA FI
## 87 3.78 18 11 114 Presente MA FI
## 88 4.26 18 17 58 Ausente MA FI
## 89 4.11 11 9 248 Ausente MA FO
## 90 5.24 15 12 249 Presente MA FO
## 91 4.24 17 9 245 Presente MA FI
## 92 4.95 18 16 183 Presente MA FI
## 93 5.19 19 9 193 Presente MA FI
## 94 3.94 16 13 75 Presente MA FI
## 95 4.60 13 12 62 Presente MA FO
## 96 5.50 18 7 253 Presente MA FO
## 97 5.68 16 9 98 Presente MA FI
## 98 5.57 16 7 79 Presente MA FO
## 99 4.73 16 15 265 Presente MA FI
## 100 4.98 18 9 259 Presente MA FI
## 101 5.79 15 10 288 Presente MA FI
## 102 4.35 17 11 110 Presente MA FI
## 103 5.36 16 16 1 Presente MA FO
## 104 5.14 19 13 84 Presente MA FO
## 105 5.02 17 13 110 Ausente MA FI
## 106 4.43 14 9 200 Presente MA FO
## 107 5.27 17 10 8 Presente MA FI
## 108 4.70 16 14 161 Presente MA FI
## 109 5.45 16 14 216 Presente MA FI
## 110 5.84 18 9 28 Ausente MA FI
## 111 6.24 17 9 195 Presente MA FI
## 112 5.57 17 13 210 Presente MA FO
## 113 4.89 17 13 74 Presente MA FO
## 114 5.65 15 2 143 Ausente MA FO
## 115 4.11 18 6 258 Ausente MA FI
## 116 5.72 13 12 273 Ausente MA FO
## 117 5.25 18 12 225 Ausente MA FI
## 118 4.04 17 12 280 Presente MA FI
## 119 5.21 17 13 102 Presente MA FI
## 120 5.51 17 12 153 Presente MA FI
tib.i=tib.c[sample(nrow(tib.c),90),]
tib.i[30,1]=NA
tib.i[80,3]=NA
tib.i
## Biomasa_gramos Flores.r Flores.d Hojas.d Plaga Estatus Fertilizacion
## 76 5.83 13 11 294 Ausente PA FI
## 94 3.94 16 13 75 Presente MA FI
## 112 5.57 17 13 210 Presente MA FO
## 77 5.70 15 12 131 Presente PA FO
## 70 4.63 16 7 277 Presente PA FO
## 45 4.87 16 14 114 Presente PA FI
## 120 5.51 17 12 153 Presente MA FI
## 25 4.50 13 9 110 Presente S FO
## 87 3.78 18 11 114 Presente MA FI
## 49 4.68 13 7 75 Presente PA FI
## 73 5.48 13 9 226 Ausente PA FI
## 20 4.53 17 12 106 Presente S FO
## 11 4.31 17 6 189 Presente S FO
## 56 3.68 14 15 76 Presente PA FI
## 90 5.24 15 12 249 Presente MA FO
## 115 4.11 18 6 258 Ausente MA FI
## 62 5.10 16 15 274 Presente PA FI
## 10 3.80 12 8 167 Presente S FO
## 101 5.79 15 10 288 Presente MA FI
## 81 4.34 16 17 31 Presente MA FI
## 59 4.09 13 11 73 Ausente PA FO
## 79 5.04 18 17 138 Presente PA FI
## 58 4.85 17 11 41 Presente PA FI
## 13 4.76 13 12 155 Presente S FO
## 24 5.20 18 6 265 Presente S FI
## 37 5.29 18 9 238 Presente S FI
## 104 5.14 19 13 84 Presente MA FO
## 54 5.28 16 5 89 Presente PA FI
## 100 4.98 18 9 259 Presente MA FI
## 117 NA 18 12 225 Ausente MA FI
## 114 5.65 15 2 143 Ausente MA FO
## 29 5.50 18 10 101 Presente S FI
## 16 3.33 16 8 213 Presente S FO
## 4 5.44 17 12 103 Presente S FI
## 42 4.39 12 11 194 Presente PA FI
## 61 4.04 19 6 170 Presente PA FO
## 41 4.48 15 12 239 Ausente PA FO
## 21 5.59 16 11 177 Presente S FO
## 32 4.31 17 11 171 Presente S FO
## 36 2.81 15 6 203 Ausente S FO
## 9 5.82 19 9 149 Presente S FO
## 46 4.18 19 11 45 Presente PA FO
## 2 6.08 17 8 186 Ausente S FI
## 84 4.73 18 13 79 Presente MA FO
## 47 4.35 15 3 186 Presente PA FO
## 1 5.82 16 10 5 Presente S FI
## 96 5.50 18 7 253 Presente MA FO
## 22 5.80 14 7 201 Presente S FI
## 113 4.89 17 13 74 Presente MA FO
## 51 6.62 14 12 10 Presente PA FI
## 3 5.40 14 11 231 Presente S FI
## 50 4.74 19 13 34 Presente PA FO
## 40 5.34 15 10 279 Ausente S FO
## 38 6.16 15 11 119 Presente S FO
## 107 5.27 17 10 8 Presente MA FI
## 18 5.46 16 9 196 Presente S FI
## 69 4.77 17 10 78 Presente PA FO
## 14 4.45 18 13 212 Presente S FO
## 8 5.21 16 9 39 Presente S FO
## 35 4.94 15 10 93 Presente S FI
## 103 5.36 16 16 1 Presente MA FO
## 48 5.65 17 9 285 Presente PA FI
## 89 4.11 11 9 248 Ausente MA FO
## 82 5.62 17 10 119 Ausente MA FI
## 99 4.73 16 15 265 Presente MA FI
## 28 4.97 16 11 33 Ausente S FI
## 78 5.19 16 10 128 Presente PA FI
## 64 5.11 18 5 212 Ausente PA FI
## 83 3.38 18 8 237 Presente MA FI
## 92 4.95 18 16 183 Presente MA FI
## 102 4.35 17 11 110 Presente MA FI
## 33 4.66 16 12 147 Presente S FO
## 85 5.63 13 8 176 Presente MA FI
## 95 4.60 13 12 62 Presente MA FO
## 39 4.07 16 12 277 Presente S FI
## 106 4.43 14 9 200 Presente MA FO
## 34 5.87 17 10 277 Presente S FI
## 15 5.06 14 11 282 Presente S FI
## 80 5.37 17 11 210 Ausente PA FI
## 31 4.48 13 NA 106 Presente S FO
## 66 4.13 15 10 47 Presente PA FO
## 19 3.79 15 11 75 Ausente S FI
## 75 5.48 18 10 253 Presente PA FI
## 23 4.77 18 16 5 Presente S FI
## 30 5.20 16 14 78 Presente S FO
## 98 5.57 16 7 79 Presente MA FO
## 43 4.23 16 5 206 Presente PA FI
## 55 4.71 19 13 107 Presente PA FO
## 71 5.70 16 15 210 Presente PA FO
## 65 4.30 17 11 95 Presente PA FI
# Punto 10.1 Seleccione una variable cualquiera con (select()) para tib.c
library(dplyr)
tib.c |> select(Biomasa_gramos)
## Biomasa_gramos
## 1 5.82
## 2 6.08
## 3 5.40
## 4 5.44
## 5 4.65
## 6 5.06
## 7 4.76
## 8 5.21
## 9 5.82
## 10 3.80
## 11 4.31
## 12 5.08
## 13 4.76
## 14 4.45
## 15 5.06
## 16 3.33
## 17 5.87
## 18 5.46
## 19 3.79
## 20 4.53
## 21 5.59
## 22 5.80
## 23 4.77
## 24 5.20
## 25 4.50
## 26 3.64
## 27 5.00
## 28 4.97
## 29 5.50
## 30 5.20
## 31 4.48
## 32 4.31
## 33 4.66
## 34 5.87
## 35 4.94
## 36 2.81
## 37 5.29
## 38 6.16
## 39 4.07
## 40 5.34
## 41 4.48
## 42 4.39
## 43 4.23
## 44 4.40
## 45 4.87
## 46 4.18
## 47 4.35
## 48 5.65
## 49 4.68
## 50 4.74
## 51 6.62
## 52 5.02
## 53 6.52
## 54 5.28
## 55 4.71
## 56 3.68
## 57 3.69
## 58 4.85
## 59 4.09
## 60 5.60
## 61 4.04
## 62 5.10
## 63 4.35
## 64 5.11
## 65 4.30
## 66 4.13
## 67 2.79
## 68 6.10
## 69 4.77
## 70 4.63
## 71 5.70
## 72 5.40
## 73 5.48
## 74 4.49
## 75 5.48
## 76 5.83
## 77 5.70
## 78 5.19
## 79 5.04
## 80 5.37
## 81 4.34
## 82 5.62
## 83 3.38
## 84 4.73
## 85 5.63
## 86 6.12
## 87 3.78
## 88 4.26
## 89 4.11
## 90 5.24
## 91 4.24
## 92 4.95
## 93 5.19
## 94 3.94
## 95 4.60
## 96 5.50
## 97 5.68
## 98 5.57
## 99 4.73
## 100 4.98
## 101 5.79
## 102 4.35
## 103 5.36
## 104 5.14
## 105 5.02
## 106 4.43
## 107 5.27
## 108 4.70
## 109 5.45
## 110 5.84
## 111 6.24
## 112 5.57
## 113 4.89
## 114 5.65
## 115 4.11
## 116 5.72
## 117 5.25
## 118 4.04
## 119 5.21
## 120 5.51
# Punto 10.2 Seleccione desde la tercera a la sexta variable con (select(:)) para tib.c
dplyr::select(tib.c,c(3:6))
## Flores.d Hojas.d Plaga Estatus
## 1 10 5 Presente S
## 2 8 186 Ausente S
## 3 11 231 Presente S
## 4 12 103 Presente S
## 5 14 196 Ausente S
## 6 16 21 Presente S
## 7 15 225 Ausente S
## 8 9 39 Presente S
## 9 9 149 Presente S
## 10 8 167 Presente S
## 11 6 189 Presente S
## 12 14 123 Presente S
## 13 12 155 Presente S
## 14 13 212 Presente S
## 15 11 282 Presente S
## 16 8 213 Presente S
## 17 4 20 Presente S
## 18 9 196 Presente S
## 19 11 75 Ausente S
## 20 12 106 Presente S
## 21 11 177 Presente S
## 22 7 201 Presente S
## 23 16 5 Presente S
## 24 6 265 Presente S
## 25 9 110 Presente S
## 26 12 155 Presente S
## 27 9 245 Ausente S
## 28 11 33 Ausente S
## 29 10 101 Presente S
## 30 14 78 Presente S
## 31 10 106 Presente S
## 32 11 171 Presente S
## 33 12 147 Presente S
## 34 10 277 Presente S
## 35 10 93 Presente S
## 36 6 203 Ausente S
## 37 9 238 Presente S
## 38 11 119 Presente S
## 39 12 277 Presente S
## 40 10 279 Ausente S
## 41 12 239 Ausente PA
## 42 11 194 Presente PA
## 43 5 206 Presente PA
## 44 7 74 Ausente PA
## 45 14 114 Presente PA
## 46 11 45 Presente PA
## 47 3 186 Presente PA
## 48 9 285 Presente PA
## 49 7 75 Presente PA
## 50 13 34 Presente PA
## 51 12 10 Presente PA
## 52 11 100 Ausente PA
## 53 17 285 Presente PA
## 54 5 89 Presente PA
## 55 13 107 Presente PA
## 56 15 76 Presente PA
## 57 9 78 Ausente PA
## 58 11 41 Presente PA
## 59 11 73 Ausente PA
## 60 6 281 Presente PA
## 61 6 170 Presente PA
## 62 15 274 Presente PA
## 63 18 223 Presente PA
## 64 5 212 Ausente PA
## 65 11 95 Presente PA
## 66 10 47 Presente PA
## 67 16 223 Presente PA
## 68 14 171 Presente PA
## 69 10 78 Presente PA
## 70 7 277 Presente PA
## 71 15 210 Presente PA
## 72 7 153 Presente PA
## 73 9 226 Ausente PA
## 74 11 244 Presente PA
## 75 10 253 Presente PA
## 76 11 294 Ausente PA
## 77 12 131 Presente PA
## 78 10 128 Presente PA
## 79 17 138 Presente PA
## 80 11 210 Ausente PA
## 81 17 31 Presente MA
## 82 10 119 Ausente MA
## 83 8 237 Presente MA
## 84 13 79 Presente MA
## 85 8 176 Presente MA
## 86 11 9 Presente MA
## 87 11 114 Presente MA
## 88 17 58 Ausente MA
## 89 9 248 Ausente MA
## 90 12 249 Presente MA
## 91 9 245 Presente MA
## 92 16 183 Presente MA
## 93 9 193 Presente MA
## 94 13 75 Presente MA
## 95 12 62 Presente MA
## 96 7 253 Presente MA
## 97 9 98 Presente MA
## 98 7 79 Presente MA
## 99 15 265 Presente MA
## 100 9 259 Presente MA
## 101 10 288 Presente MA
## 102 11 110 Presente MA
## 103 16 1 Presente MA
## 104 13 84 Presente MA
## 105 13 110 Ausente MA
## 106 9 200 Presente MA
## 107 10 8 Presente MA
## 108 14 161 Presente MA
## 109 14 216 Presente MA
## 110 9 28 Ausente MA
## 111 9 195 Presente MA
## 112 13 210 Presente MA
## 113 13 74 Presente MA
## 114 2 143 Ausente MA
## 115 6 258 Ausente MA
## 116 12 273 Ausente MA
## 117 12 225 Ausente MA
## 118 12 280 Presente MA
## 119 13 102 Presente MA
## 120 12 153 Presente MA
# Punto 10.3 No seleccione desde la tercera a la sexta variable con (select(!(:))) para tib.c
dplyr::select(tib.c,!c(3:6))
## Biomasa_gramos Flores.r Fertilizacion
## 1 5.82 16 FI
## 2 6.08 17 FI
## 3 5.40 14 FI
## 4 5.44 17 FI
## 5 4.65 16 FI
## 6 5.06 17 FO
## 7 4.76 15 FI
## 8 5.21 16 FO
## 9 5.82 19 FO
## 10 3.80 12 FO
## 11 4.31 17 FO
## 12 5.08 16 FO
## 13 4.76 13 FO
## 14 4.45 18 FO
## 15 5.06 14 FI
## 16 3.33 16 FO
## 17 5.87 15 FI
## 18 5.46 16 FI
## 19 3.79 15 FI
## 20 4.53 17 FO
## 21 5.59 16 FO
## 22 5.80 14 FI
## 23 4.77 18 FI
## 24 5.20 18 FI
## 25 4.50 13 FO
## 26 3.64 17 FI
## 27 5.00 14 FI
## 28 4.97 16 FI
## 29 5.50 18 FI
## 30 5.20 16 FO
## 31 4.48 13 FO
## 32 4.31 17 FO
## 33 4.66 16 FO
## 34 5.87 17 FI
## 35 4.94 15 FI
## 36 2.81 15 FO
## 37 5.29 18 FI
## 38 6.16 15 FO
## 39 4.07 16 FI
## 40 5.34 15 FO
## 41 4.48 15 FO
## 42 4.39 12 FI
## 43 4.23 16 FI
## 44 4.40 18 FO
## 45 4.87 16 FI
## 46 4.18 19 FO
## 47 4.35 15 FO
## 48 5.65 17 FI
## 49 4.68 13 FI
## 50 4.74 19 FO
## 51 6.62 14 FI
## 52 5.02 18 FI
## 53 6.52 17 FI
## 54 5.28 16 FI
## 55 4.71 19 FO
## 56 3.68 14 FI
## 57 3.69 16 FO
## 58 4.85 17 FI
## 59 4.09 13 FO
## 60 5.60 17 FI
## 61 4.04 19 FO
## 62 5.10 16 FI
## 63 4.35 15 FI
## 64 5.11 18 FI
## 65 4.30 17 FI
## 66 4.13 15 FO
## 67 2.79 14 FO
## 68 6.10 18 FI
## 69 4.77 17 FO
## 70 4.63 16 FO
## 71 5.70 16 FO
## 72 5.40 18 FI
## 73 5.48 13 FI
## 74 4.49 16 FI
## 75 5.48 18 FI
## 76 5.83 13 FI
## 77 5.70 15 FO
## 78 5.19 16 FI
## 79 5.04 18 FI
## 80 5.37 17 FI
## 81 4.34 16 FI
## 82 5.62 17 FI
## 83 3.38 18 FI
## 84 4.73 18 FO
## 85 5.63 13 FI
## 86 6.12 15 FI
## 87 3.78 18 FI
## 88 4.26 18 FI
## 89 4.11 11 FO
## 90 5.24 15 FO
## 91 4.24 17 FI
## 92 4.95 18 FI
## 93 5.19 19 FI
## 94 3.94 16 FI
## 95 4.60 13 FO
## 96 5.50 18 FO
## 97 5.68 16 FI
## 98 5.57 16 FO
## 99 4.73 16 FI
## 100 4.98 18 FI
## 101 5.79 15 FI
## 102 4.35 17 FI
## 103 5.36 16 FO
## 104 5.14 19 FO
## 105 5.02 17 FI
## 106 4.43 14 FO
## 107 5.27 17 FI
## 108 4.70 16 FI
## 109 5.45 16 FI
## 110 5.84 18 FI
## 111 6.24 17 FI
## 112 5.57 17 FO
## 113 4.89 17 FO
## 114 5.65 15 FO
## 115 4.11 18 FI
## 116 5.72 13 FO
## 117 5.25 18 FI
## 118 4.04 17 FI
## 119 5.21 17 FI
## 120 5.51 17 FI
# Punto 10.4 Seleccione las que no finalizan con .d usando (select(!ends with()))
library(dplyr)
tib.c |> select(!ends_with(".d"))
## Biomasa_gramos Flores.r Plaga Estatus Fertilizacion
## 1 5.82 16 Presente S FI
## 2 6.08 17 Ausente S FI
## 3 5.40 14 Presente S FI
## 4 5.44 17 Presente S FI
## 5 4.65 16 Ausente S FI
## 6 5.06 17 Presente S FO
## 7 4.76 15 Ausente S FI
## 8 5.21 16 Presente S FO
## 9 5.82 19 Presente S FO
## 10 3.80 12 Presente S FO
## 11 4.31 17 Presente S FO
## 12 5.08 16 Presente S FO
## 13 4.76 13 Presente S FO
## 14 4.45 18 Presente S FO
## 15 5.06 14 Presente S FI
## 16 3.33 16 Presente S FO
## 17 5.87 15 Presente S FI
## 18 5.46 16 Presente S FI
## 19 3.79 15 Ausente S FI
## 20 4.53 17 Presente S FO
## 21 5.59 16 Presente S FO
## 22 5.80 14 Presente S FI
## 23 4.77 18 Presente S FI
## 24 5.20 18 Presente S FI
## 25 4.50 13 Presente S FO
## 26 3.64 17 Presente S FI
## 27 5.00 14 Ausente S FI
## 28 4.97 16 Ausente S FI
## 29 5.50 18 Presente S FI
## 30 5.20 16 Presente S FO
## 31 4.48 13 Presente S FO
## 32 4.31 17 Presente S FO
## 33 4.66 16 Presente S FO
## 34 5.87 17 Presente S FI
## 35 4.94 15 Presente S FI
## 36 2.81 15 Ausente S FO
## 37 5.29 18 Presente S FI
## 38 6.16 15 Presente S FO
## 39 4.07 16 Presente S FI
## 40 5.34 15 Ausente S FO
## 41 4.48 15 Ausente PA FO
## 42 4.39 12 Presente PA FI
## 43 4.23 16 Presente PA FI
## 44 4.40 18 Ausente PA FO
## 45 4.87 16 Presente PA FI
## 46 4.18 19 Presente PA FO
## 47 4.35 15 Presente PA FO
## 48 5.65 17 Presente PA FI
## 49 4.68 13 Presente PA FI
## 50 4.74 19 Presente PA FO
## 51 6.62 14 Presente PA FI
## 52 5.02 18 Ausente PA FI
## 53 6.52 17 Presente PA FI
## 54 5.28 16 Presente PA FI
## 55 4.71 19 Presente PA FO
## 56 3.68 14 Presente PA FI
## 57 3.69 16 Ausente PA FO
## 58 4.85 17 Presente PA FI
## 59 4.09 13 Ausente PA FO
## 60 5.60 17 Presente PA FI
## 61 4.04 19 Presente PA FO
## 62 5.10 16 Presente PA FI
## 63 4.35 15 Presente PA FI
## 64 5.11 18 Ausente PA FI
## 65 4.30 17 Presente PA FI
## 66 4.13 15 Presente PA FO
## 67 2.79 14 Presente PA FO
## 68 6.10 18 Presente PA FI
## 69 4.77 17 Presente PA FO
## 70 4.63 16 Presente PA FO
## 71 5.70 16 Presente PA FO
## 72 5.40 18 Presente PA FI
## 73 5.48 13 Ausente PA FI
## 74 4.49 16 Presente PA FI
## 75 5.48 18 Presente PA FI
## 76 5.83 13 Ausente PA FI
## 77 5.70 15 Presente PA FO
## 78 5.19 16 Presente PA FI
## 79 5.04 18 Presente PA FI
## 80 5.37 17 Ausente PA FI
## 81 4.34 16 Presente MA FI
## 82 5.62 17 Ausente MA FI
## 83 3.38 18 Presente MA FI
## 84 4.73 18 Presente MA FO
## 85 5.63 13 Presente MA FI
## 86 6.12 15 Presente MA FI
## 87 3.78 18 Presente MA FI
## 88 4.26 18 Ausente MA FI
## 89 4.11 11 Ausente MA FO
## 90 5.24 15 Presente MA FO
## 91 4.24 17 Presente MA FI
## 92 4.95 18 Presente MA FI
## 93 5.19 19 Presente MA FI
## 94 3.94 16 Presente MA FI
## 95 4.60 13 Presente MA FO
## 96 5.50 18 Presente MA FO
## 97 5.68 16 Presente MA FI
## 98 5.57 16 Presente MA FO
## 99 4.73 16 Presente MA FI
## 100 4.98 18 Presente MA FI
## 101 5.79 15 Presente MA FI
## 102 4.35 17 Presente MA FI
## 103 5.36 16 Presente MA FO
## 104 5.14 19 Presente MA FO
## 105 5.02 17 Ausente MA FI
## 106 4.43 14 Presente MA FO
## 107 5.27 17 Presente MA FI
## 108 4.70 16 Presente MA FI
## 109 5.45 16 Presente MA FI
## 110 5.84 18 Ausente MA FI
## 111 6.24 17 Presente MA FI
## 112 5.57 17 Presente MA FO
## 113 4.89 17 Presente MA FO
## 114 5.65 15 Ausente MA FO
## 115 4.11 18 Ausente MA FI
## 116 5.72 13 Ausente MA FO
## 117 5.25 18 Ausente MA FI
## 118 4.04 17 Presente MA FI
## 119 5.21 17 Presente MA FI
## 120 5.51 17 Presente MA FI
# Punto 10.5 Seleccione las que comienzan con Fl usando (select(starts with()))
tib.c |> select(starts_with("Fl"))
## Flores.r Flores.d
## 1 16 10
## 2 17 8
## 3 14 11
## 4 17 12
## 5 16 14
## 6 17 16
## 7 15 15
## 8 16 9
## 9 19 9
## 10 12 8
## 11 17 6
## 12 16 14
## 13 13 12
## 14 18 13
## 15 14 11
## 16 16 8
## 17 15 4
## 18 16 9
## 19 15 11
## 20 17 12
## 21 16 11
## 22 14 7
## 23 18 16
## 24 18 6
## 25 13 9
## 26 17 12
## 27 14 9
## 28 16 11
## 29 18 10
## 30 16 14
## 31 13 10
## 32 17 11
## 33 16 12
## 34 17 10
## 35 15 10
## 36 15 6
## 37 18 9
## 38 15 11
## 39 16 12
## 40 15 10
## 41 15 12
## 42 12 11
## 43 16 5
## 44 18 7
## 45 16 14
## 46 19 11
## 47 15 3
## 48 17 9
## 49 13 7
## 50 19 13
## 51 14 12
## 52 18 11
## 53 17 17
## 54 16 5
## 55 19 13
## 56 14 15
## 57 16 9
## 58 17 11
## 59 13 11
## 60 17 6
## 61 19 6
## 62 16 15
## 63 15 18
## 64 18 5
## 65 17 11
## 66 15 10
## 67 14 16
## 68 18 14
## 69 17 10
## 70 16 7
## 71 16 15
## 72 18 7
## 73 13 9
## 74 16 11
## 75 18 10
## 76 13 11
## 77 15 12
## 78 16 10
## 79 18 17
## 80 17 11
## 81 16 17
## 82 17 10
## 83 18 8
## 84 18 13
## 85 13 8
## 86 15 11
## 87 18 11
## 88 18 17
## 89 11 9
## 90 15 12
## 91 17 9
## 92 18 16
## 93 19 9
## 94 16 13
## 95 13 12
## 96 18 7
## 97 16 9
## 98 16 7
## 99 16 15
## 100 18 9
## 101 15 10
## 102 17 11
## 103 16 16
## 104 19 13
## 105 17 13
## 106 14 9
## 107 17 10
## 108 16 14
## 109 16 14
## 110 18 9
## 111 17 9
## 112 17 13
## 113 17 13
## 114 15 2
## 115 18 6
## 116 13 12
## 117 18 12
## 118 17 12
## 119 17 13
## 120 17 12
# Punto 10.6 Seleccione las que comienzan con F y terminan con .d usando (select(starts with()&ends with()))
tib.c |> select(starts_with("F")& ends_with(".d"))
## Flores.d
## 1 10
## 2 8
## 3 11
## 4 12
## 5 14
## 6 16
## 7 15
## 8 9
## 9 9
## 10 8
## 11 6
## 12 14
## 13 12
## 14 13
## 15 11
## 16 8
## 17 4
## 18 9
## 19 11
## 20 12
## 21 11
## 22 7
## 23 16
## 24 6
## 25 9
## 26 12
## 27 9
## 28 11
## 29 10
## 30 14
## 31 10
## 32 11
## 33 12
## 34 10
## 35 10
## 36 6
## 37 9
## 38 11
## 39 12
## 40 10
## 41 12
## 42 11
## 43 5
## 44 7
## 45 14
## 46 11
## 47 3
## 48 9
## 49 7
## 50 13
## 51 12
## 52 11
## 53 17
## 54 5
## 55 13
## 56 15
## 57 9
## 58 11
## 59 11
## 60 6
## 61 6
## 62 15
## 63 18
## 64 5
## 65 11
## 66 10
## 67 16
## 68 14
## 69 10
## 70 7
## 71 15
## 72 7
## 73 9
## 74 11
## 75 10
## 76 11
## 77 12
## 78 10
## 79 17
## 80 11
## 81 17
## 82 10
## 83 8
## 84 13
## 85 8
## 86 11
## 87 11
## 88 17
## 89 9
## 90 12
## 91 9
## 92 16
## 93 9
## 94 13
## 95 12
## 96 7
## 97 9
## 98 7
## 99 15
## 100 9
## 101 10
## 102 11
## 103 16
## 104 13
## 105 13
## 106 9
## 107 10
## 108 14
## 109 14
## 110 9
## 111 9
## 112 13
## 113 13
## 114 2
## 115 6
## 116 12
## 117 12
## 118 12
## 119 13
## 120 12
# Punto 10.7 Seleccione una variable cualquiera con (select()) para tib:c y agrúpela por Estatus usando ( group by() )
var_Estatus<-tib.c |> select(1) |> group_by(tib.c$Estatus)
var_Estatus
## # A tibble: 120 x 2
## # Groups: tib.c$Estatus [3]
## Biomasa_gramos `tib.c$Estatus`
## <dbl> <fct>
## 1 5.82 S
## 2 6.08 S
## 3 5.4 S
## 4 5.44 S
## 5 4.65 S
## 6 5.06 S
## 7 4.76 S
## 8 5.21 S
## 9 5.82 S
## 10 3.8 S
## # ... with 110 more rows
# Punto 10.8 Guarde el resultado previo en la variable var estatus y ordene de mayor a menor por la misma variable anterior usando (arrange(desc(), .by group = TRUE)) para tib.c
var_Estatus |> arrange(desc(Biomasa_gramos),.by_group = T)
## # A tibble: 120 x 2
## # Groups: tib.c$Estatus [3]
## Biomasa_gramos `tib.c$Estatus`
## <dbl> <fct>
## 1 6.16 S
## 2 6.08 S
## 3 5.87 S
## 4 5.87 S
## 5 5.82 S
## 6 5.82 S
## 7 5.8 S
## 8 5.59 S
## 9 5.5 S
## 10 5.46 S
## # ... with 110 more rows
# Punto 10.9 Filtre los datos que comienzan con Flores para el estatus muy afectadas (Filter(,) )
tib.c |> select(starts_with("Flores")) |> filter(tib.c$Estatus=="MA")
## Flores.r Flores.d
## 1 16 17
## 2 17 10
## 3 18 8
## 4 18 13
## 5 13 8
## 6 15 11
## 7 18 11
## 8 18 17
## 9 11 9
## 10 15 12
## 11 17 9
## 12 18 16
## 13 19 9
## 14 16 13
## 15 13 12
## 16 18 7
## 17 16 9
## 18 16 7
## 19 16 15
## 20 18 9
## 21 15 10
## 22 17 11
## 23 16 16
## 24 19 13
## 25 17 13
## 26 14 9
## 27 17 10
## 28 16 14
## 29 16 14
## 30 18 9
## 31 17 9
## 32 17 13
## 33 17 13
## 34 15 2
## 35 18 6
## 36 13 12
## 37 18 12
## 38 17 12
## 39 17 13
## 40 17 12
# Punto 10.10 . Filtre los datos para cuando la biomasa es superior a 5 gramos
tib.c |> filter(Biomasa_gramos>5)
## Biomasa_gramos Flores.r Flores.d Hojas.d Plaga Estatus Fertilizacion
## 1 5.82 16 10 5 Presente S FI
## 2 6.08 17 8 186 Ausente S FI
## 3 5.40 14 11 231 Presente S FI
## 4 5.44 17 12 103 Presente S FI
## 5 5.06 17 16 21 Presente S FO
## 6 5.21 16 9 39 Presente S FO
## 7 5.82 19 9 149 Presente S FO
## 8 5.08 16 14 123 Presente S FO
## 9 5.06 14 11 282 Presente S FI
## 10 5.87 15 4 20 Presente S FI
## 11 5.46 16 9 196 Presente S FI
## 12 5.59 16 11 177 Presente S FO
## 13 5.80 14 7 201 Presente S FI
## 14 5.20 18 6 265 Presente S FI
## 15 5.50 18 10 101 Presente S FI
## 16 5.20 16 14 78 Presente S FO
## 17 5.87 17 10 277 Presente S FI
## 18 5.29 18 9 238 Presente S FI
## 19 6.16 15 11 119 Presente S FO
## 20 5.34 15 10 279 Ausente S FO
## 21 5.65 17 9 285 Presente PA FI
## 22 6.62 14 12 10 Presente PA FI
## 23 5.02 18 11 100 Ausente PA FI
## 24 6.52 17 17 285 Presente PA FI
## 25 5.28 16 5 89 Presente PA FI
## 26 5.60 17 6 281 Presente PA FI
## 27 5.10 16 15 274 Presente PA FI
## 28 5.11 18 5 212 Ausente PA FI
## 29 6.10 18 14 171 Presente PA FI
## 30 5.70 16 15 210 Presente PA FO
## 31 5.40 18 7 153 Presente PA FI
## 32 5.48 13 9 226 Ausente PA FI
## 33 5.48 18 10 253 Presente PA FI
## 34 5.83 13 11 294 Ausente PA FI
## 35 5.70 15 12 131 Presente PA FO
## 36 5.19 16 10 128 Presente PA FI
## 37 5.04 18 17 138 Presente PA FI
## 38 5.37 17 11 210 Ausente PA FI
## 39 5.62 17 10 119 Ausente MA FI
## 40 5.63 13 8 176 Presente MA FI
## 41 6.12 15 11 9 Presente MA FI
## 42 5.24 15 12 249 Presente MA FO
## 43 5.19 19 9 193 Presente MA FI
## 44 5.50 18 7 253 Presente MA FO
## 45 5.68 16 9 98 Presente MA FI
## 46 5.57 16 7 79 Presente MA FO
## 47 5.79 15 10 288 Presente MA FI
## 48 5.36 16 16 1 Presente MA FO
## 49 5.14 19 13 84 Presente MA FO
## 50 5.02 17 13 110 Ausente MA FI
## 51 5.27 17 10 8 Presente MA FI
## 52 5.45 16 14 216 Presente MA FI
## 53 5.84 18 9 28 Ausente MA FI
## 54 6.24 17 9 195 Presente MA FI
## 55 5.57 17 13 210 Presente MA FO
## 56 5.65 15 2 143 Ausente MA FO
## 57 5.72 13 12 273 Ausente MA FO
## 58 5.25 18 12 225 Ausente MA FI
## 59 5.21 17 13 102 Presente MA FI
## 60 5.51 17 12 153 Presente MA FI
# Punto 10.11 Filtre los datos para tener solo fertilización se tienen plantas parcialmente afectadas y fueron tratadas con fertilización orgánica
tib.c |> filter(tib.c$Fertilizacion=="FO",tib.c$Estatus=="PA")
## Biomasa_gramos Flores.r Flores.d Hojas.d Plaga Estatus Fertilizacion
## 1 4.48 15 12 239 Ausente PA FO
## 2 4.40 18 7 74 Ausente PA FO
## 3 4.18 19 11 45 Presente PA FO
## 4 4.35 15 3 186 Presente PA FO
## 5 4.74 19 13 34 Presente PA FO
## 6 4.71 19 13 107 Presente PA FO
## 7 3.69 16 9 78 Ausente PA FO
## 8 4.09 13 11 73 Ausente PA FO
## 9 4.04 19 6 170 Presente PA FO
## 10 4.13 15 10 47 Presente PA FO
## 11 2.79 14 16 223 Presente PA FO
## 12 4.77 17 10 78 Presente PA FO
## 13 4.63 16 7 277 Presente PA FO
## 14 5.70 16 15 210 Presente PA FO
## 15 5.70 15 12 131 Presente PA FO
# Punto 10.12 Filtre los datos para tener solo fertilización se tienen plantas parcialmente afectadas o fueron tratadas con fertilización inorgánica
tib.c |> filter(tib.c$Fertilizacion=="FI"|tib.c$Estatus=="PA")
## Biomasa_gramos Flores.r Flores.d Hojas.d Plaga Estatus Fertilizacion
## 1 5.82 16 10 5 Presente S FI
## 2 6.08 17 8 186 Ausente S FI
## 3 5.40 14 11 231 Presente S FI
## 4 5.44 17 12 103 Presente S FI
## 5 4.65 16 14 196 Ausente S FI
## 6 4.76 15 15 225 Ausente S FI
## 7 5.06 14 11 282 Presente S FI
## 8 5.87 15 4 20 Presente S FI
## 9 5.46 16 9 196 Presente S FI
## 10 3.79 15 11 75 Ausente S FI
## 11 5.80 14 7 201 Presente S FI
## 12 4.77 18 16 5 Presente S FI
## 13 5.20 18 6 265 Presente S FI
## 14 3.64 17 12 155 Presente S FI
## 15 5.00 14 9 245 Ausente S FI
## 16 4.97 16 11 33 Ausente S FI
## 17 5.50 18 10 101 Presente S FI
## 18 5.87 17 10 277 Presente S FI
## 19 4.94 15 10 93 Presente S FI
## 20 5.29 18 9 238 Presente S FI
## 21 4.07 16 12 277 Presente S FI
## 22 4.48 15 12 239 Ausente PA FO
## 23 4.39 12 11 194 Presente PA FI
## 24 4.23 16 5 206 Presente PA FI
## 25 4.40 18 7 74 Ausente PA FO
## 26 4.87 16 14 114 Presente PA FI
## 27 4.18 19 11 45 Presente PA FO
## 28 4.35 15 3 186 Presente PA FO
## 29 5.65 17 9 285 Presente PA FI
## 30 4.68 13 7 75 Presente PA FI
## 31 4.74 19 13 34 Presente PA FO
## 32 6.62 14 12 10 Presente PA FI
## 33 5.02 18 11 100 Ausente PA FI
## 34 6.52 17 17 285 Presente PA FI
## 35 5.28 16 5 89 Presente PA FI
## 36 4.71 19 13 107 Presente PA FO
## 37 3.68 14 15 76 Presente PA FI
## 38 3.69 16 9 78 Ausente PA FO
## 39 4.85 17 11 41 Presente PA FI
## 40 4.09 13 11 73 Ausente PA FO
## 41 5.60 17 6 281 Presente PA FI
## 42 4.04 19 6 170 Presente PA FO
## 43 5.10 16 15 274 Presente PA FI
## 44 4.35 15 18 223 Presente PA FI
## 45 5.11 18 5 212 Ausente PA FI
## 46 4.30 17 11 95 Presente PA FI
## 47 4.13 15 10 47 Presente PA FO
## 48 2.79 14 16 223 Presente PA FO
## 49 6.10 18 14 171 Presente PA FI
## 50 4.77 17 10 78 Presente PA FO
## 51 4.63 16 7 277 Presente PA FO
## 52 5.70 16 15 210 Presente PA FO
## 53 5.40 18 7 153 Presente PA FI
## 54 5.48 13 9 226 Ausente PA FI
## 55 4.49 16 11 244 Presente PA FI
## 56 5.48 18 10 253 Presente PA FI
## 57 5.83 13 11 294 Ausente PA FI
## 58 5.70 15 12 131 Presente PA FO
## 59 5.19 16 10 128 Presente PA FI
## 60 5.04 18 17 138 Presente PA FI
## 61 5.37 17 11 210 Ausente PA FI
## 62 4.34 16 17 31 Presente MA FI
## 63 5.62 17 10 119 Ausente MA FI
## 64 3.38 18 8 237 Presente MA FI
## 65 5.63 13 8 176 Presente MA FI
## 66 6.12 15 11 9 Presente MA FI
## 67 3.78 18 11 114 Presente MA FI
## 68 4.26 18 17 58 Ausente MA FI
## 69 4.24 17 9 245 Presente MA FI
## 70 4.95 18 16 183 Presente MA FI
## 71 5.19 19 9 193 Presente MA FI
## 72 3.94 16 13 75 Presente MA FI
## 73 5.68 16 9 98 Presente MA FI
## 74 4.73 16 15 265 Presente MA FI
## 75 4.98 18 9 259 Presente MA FI
## 76 5.79 15 10 288 Presente MA FI
## 77 4.35 17 11 110 Presente MA FI
## 78 5.02 17 13 110 Ausente MA FI
## 79 5.27 17 10 8 Presente MA FI
## 80 4.70 16 14 161 Presente MA FI
## 81 5.45 16 14 216 Presente MA FI
## 82 5.84 18 9 28 Ausente MA FI
## 83 6.24 17 9 195 Presente MA FI
## 84 4.11 18 6 258 Ausente MA FI
## 85 5.25 18 12 225 Ausente MA FI
## 86 4.04 17 12 280 Presente MA FI
## 87 5.21 17 13 102 Presente MA FI
## 88 5.51 17 12 153 Presente MA FI
# Punto 10.13 Filtre los datos de Flores desprendidas por presencia o ausencia de plaga para cuando el número de flores desprendidas es mayor a su mediana
tib.c |> group_by(Plaga) |> select(Flores.d) |> filter(Flores.d>median(Flores.d))
## Adding missing grouping variables: `Plaga`
## # A tibble: 53 x 2
## # Groups: Plaga [2]
## Plaga Flores.d
## <chr> <int>
## 1 Presente 12
## 2 Ausente 14
## 3 Presente 16
## 4 Ausente 15
## 5 Presente 14
## 6 Presente 12
## 7 Presente 13
## 8 Ausente 11
## 9 Presente 12
## 10 Presente 16
## # ... with 43 more rows
median(tib.c$Flores.d)
## [1] 11
# Punto 10.14 Filtre los datos de una de las variables con datos faltantes por presencia o ausencia de plaga para cuando el valor de la variable con faltante es mayor a su mediana. Compare los resultados en los dos conjuntos de datos (completo o muestreado). Si encuentra diferencias en la mediana use median (, na.rm= TRUE)
tib.c |> group_by(tib.c$Plaga) |> select(Biomasa_gramos) |> filter(Biomasa_gramos>median(Biomasa_gramos))
## Adding missing grouping variables: `tib.c$Plaga`
## # A tibble: 60 x 2
## # Groups: tib.c$Plaga [2]
## `tib.c$Plaga` Biomasa_gramos
## <chr> <dbl>
## 1 Presente 5.82
## 2 Ausente 6.08
## 3 Presente 5.4
## 4 Presente 5.44
## 5 Presente 5.06
## 6 Presente 5.21
## 7 Presente 5.82
## 8 Presente 5.08
## 9 Presente 5.06
## 10 Presente 5.87
## # ... with 50 more rows
tib.i |> group_by(tib.i$Plaga) |> select(Biomasa_gramos) |> filter(Biomasa_gramos>median(Biomasa_gramos, na.rm = T))
## Adding missing grouping variables: `tib.i$Plaga`
## # A tibble: 44 x 2
## # Groups: tib.i$Plaga [2]
## `tib.i$Plaga` Biomasa_gramos
## <chr> <dbl>
## 1 Ausente 5.83
## 2 Presente 5.57
## 3 Presente 5.7
## 4 Presente 5.51
## 5 Ausente 5.48
## 6 Presente 5.24
## 7 Presente 5.1
## 8 Presente 5.79
## 9 Presente 5.04
## 10 Presente 5.2
## # ... with 34 more rows
median(tib.c$Biomasa_gramos)
## [1] 5.01
median(tib.i$Biomasa_gramos,na.rm =T)
## [1] 4.95
# Punto 10.15 Seleccione dos variables cuantitativas y asígnelas a un vector con c(,) y nómbrelo con v1. Ponga en otro vector dos valores numéricos que sirvan de condición a cada variable, por ejemplo, el cuartil inferior para una y el cuartil superior para la otra y ll ́amelo v2. Usando ahora pipes, llame el data.frame completo y filtre usando el operador punto para seleccionar aquellos datos que superan respectivamente cada variable el valor de la condición. Use ( v1 = c(); v2 = c();tib.c % > %filter(.data[[v1[[1]] > v2[[1]], .data[[v1[[2]] > v2[[2]]))
v1=c("Flores.d","Biomasa_gramos")
quantile(tib.c$Flores.d)
## 0% 25% 50% 75% 100%
## 2 9 11 13 18
quantile(tib.c$Biomasa_gramos)
## 0% 25% 50% 75% 100%
## 2.7900 4.3975 5.0100 5.4850 6.6200
v2=c(8,5.49)
v1 = c("Flores.d","Biomasa_gramos"); v2 = c(8,5.49);tib.c %>% filter( .data[[v1[[1]]]] > v2[[1]],
.data[[v1[[2]]]] > v2[[2]])
## Biomasa_gramos Flores.r Flores.d Hojas.d Plaga Estatus Fertilizacion
## 1 5.82 16 10 5 Presente S FI
## 2 5.82 19 9 149 Presente S FO
## 3 5.59 16 11 177 Presente S FO
## 4 5.50 18 10 101 Presente S FI
## 5 5.87 17 10 277 Presente S FI
## 6 6.16 15 11 119 Presente S FO
## 7 5.65 17 9 285 Presente PA FI
## 8 6.62 14 12 10 Presente PA FI
## 9 6.52 17 17 285 Presente PA FI
## 10 6.10 18 14 171 Presente PA FI
## 11 5.70 16 15 210 Presente PA FO
## 12 5.83 13 11 294 Ausente PA FI
## 13 5.70 15 12 131 Presente PA FO
## 14 5.62 17 10 119 Ausente MA FI
## 15 6.12 15 11 9 Presente MA FI
## 16 5.68 16 9 98 Presente MA FI
## 17 5.79 15 10 288 Presente MA FI
## 18 5.84 18 9 28 Ausente MA FI
## 19 6.24 17 9 195 Presente MA FI
## 20 5.57 17 13 210 Presente MA FO
## 21 5.72 13 12 273 Ausente MA FO
## 22 5.51 17 12 153 Presente MA FI
# Punto 10.16 Cree un data frame o tableta con todas las variables cuantitativas continúas estandarizadas con el (score z) y las discretas con la estandarización minimax y llámelo tib.e. Use (mutate())
library(dplyr)
#variable continua biomasa z_score estandarizada
tib.e_stand<-tib.c |> mutate_at(c("Biomasa_gramos"),~(scale(.) %>% as.vector) )
#varibles discretas min_max (flores-hojas)
min_max_norm <- function(x) {
(x - min(x)) / (max(x) - min(x))
}
tib.e_norm<- as.data.frame(lapply(tib.c[2:4],min_max_norm))
tib.e<-mutate(tib.e_stand,tib.e_norm)
tib.e
## Biomasa_gramos Flores.r Flores.d Hojas.d Plaga Estatus Fertilizacion
## 1 1.192880659 0.625 0.5000 0.01365188 Presente S FI
## 2 1.542475592 0.750 0.3750 0.63139932 Ausente S FI
## 3 0.628150383 0.375 0.5625 0.78498294 Presente S FI
## 4 0.681934219 0.750 0.6250 0.34812287 Presente S FI
## 5 -0.380296539 0.625 0.7500 0.66552901 Ausente S FI
## 6 0.170987778 0.750 0.8750 0.06825939 Presente S FO
## 7 -0.232390991 0.500 0.8125 0.76450512 Ausente S FI
## 8 0.372677163 0.625 0.4375 0.12969283 Presente S FO
## 9 1.192880659 1.000 0.4375 0.50511945 Presente S FO
## 10 -1.523203051 0.125 0.3750 0.56655290 Presente S FO
## 11 -0.837459144 0.750 0.2500 0.64163823 Presente S FO
## 12 0.197879696 0.625 0.7500 0.41638225 Presente S FO
## 13 -0.232390991 0.250 0.6250 0.52559727 Presente S FO
## 14 -0.649215719 0.875 0.6875 0.72013652 Presente S FO
## 15 0.170987778 0.375 0.5625 0.95904437 Presente S FI
## 16 -2.155163123 0.625 0.3750 0.72354949 Presente S FO
## 17 1.260110454 0.500 0.1250 0.06484642 Presente S FI
## 18 0.708826137 0.625 0.4375 0.66552901 Presente S FI
## 19 -1.536649010 0.500 0.5625 0.25255973 Ausente S FI
## 20 -0.541648047 0.750 0.6250 0.35836177 Presente S FO
## 21 0.883623603 0.625 0.5625 0.60068259 Presente S FO
## 22 1.165988741 0.375 0.3125 0.68259386 Presente S FI
## 23 -0.218945032 0.875 0.8750 0.01365188 Presente S FI
## 24 0.359231204 0.875 0.2500 0.90102389 Presente S FI
## 25 -0.581985924 0.250 0.4375 0.37201365 Presente S FO
## 26 -1.738338395 0.750 0.6250 0.52559727 Presente S FI
## 27 0.090312024 0.375 0.4375 0.83276451 Ausente S FI
## 28 0.049974147 0.625 0.5625 0.10921502 Ausente S FI
## 29 0.762609973 0.875 0.5000 0.34129693 Presente S FI
## 30 0.359231204 0.625 0.7500 0.26279863 Presente S FO
## 31 -0.608877842 0.250 0.5000 0.35836177 Presente S FO
## 32 -0.837459144 0.750 0.5625 0.58020478 Presente S FO
## 33 -0.366850580 0.625 0.6250 0.49829352 Presente S FO
## 34 1.260110454 0.750 0.5000 0.94197952 Presente S FI
## 35 0.009636271 0.500 0.5000 0.31399317 Presente S FI
## 36 -2.854352989 0.500 0.2500 0.68941980 Ausente S FO
## 37 0.480244834 0.875 0.4375 0.80887372 Presente S FI
## 38 1.650043264 0.500 0.5625 0.40273038 Presente S FO
## 39 -1.160162159 0.625 0.6250 0.94197952 Presente S FI
## 40 0.547474629 0.500 0.5000 0.94880546 Ausente S FO
## 41 -0.608877842 0.500 0.6250 0.81228669 Ausente PA FO
## 42 -0.729891472 0.125 0.5625 0.65870307 Presente PA FI
## 43 -0.945026816 0.625 0.1875 0.69965870 Presente PA FI
## 44 -0.716445513 0.875 0.3125 0.24914676 Ausente PA FO
## 45 -0.084485442 0.625 0.7500 0.38566553 Presente PA FI
## 46 -1.012256611 1.000 0.5625 0.15017065 Presente PA FO
## 47 -0.783675308 0.500 0.0625 0.63139932 Presente PA FO
## 48 0.964299357 0.750 0.4375 0.96928328 Presente PA FI
## 49 -0.339958662 0.250 0.3125 0.25255973 Presente PA FI
## 50 -0.259282909 1.000 0.6875 0.11262799 Presente PA FO
## 51 2.268557377 0.375 0.6250 0.03071672 Presente PA FI
## 52 0.117203942 0.875 0.5625 0.33788396 Ausente PA FI
## 53 2.134097787 0.750 0.9375 0.96928328 Presente PA FI
## 54 0.466798875 0.625 0.1875 0.30034130 Presente PA FI
## 55 -0.299620786 1.000 0.6875 0.36177474 Presente PA FO
## 56 -1.684554559 0.375 0.8125 0.25597270 Presente PA FI
## 57 -1.671108600 0.625 0.4375 0.26279863 Ausente PA FO
## 58 -0.111377360 0.750 0.5625 0.13651877 Presente PA FI
## 59 -1.133270241 0.250 0.5625 0.24573379 Ausente PA FO
## 60 0.897069562 0.750 0.2500 0.95563140 Presente PA FI
## 61 -1.200500036 1.000 0.2500 0.57679181 Presente PA FO
## 62 0.224771614 0.625 0.8125 0.93174061 Presente PA FI
## 63 -0.783675308 0.500 1.0000 0.75767918 Presente PA FI
## 64 0.238217573 0.875 0.1875 0.72013652 Ausente PA FI
## 65 -0.850905103 0.750 0.5625 0.32081911 Presente PA FI
## 66 -1.079486405 0.500 0.5000 0.15699659 Presente PA FO
## 67 -2.881244907 0.375 0.8750 0.75767918 Presente PA FO
## 68 1.569367510 0.875 0.7500 0.58020478 Presente PA FI
## 69 -0.218945032 0.750 0.5000 0.26279863 Presente PA FO
## 70 -0.407188457 0.625 0.3125 0.94197952 Presente PA FO
## 71 1.031529152 0.625 0.8125 0.71331058 Presente PA FO
## 72 0.628150383 0.875 0.3125 0.51877133 Presente PA FI
## 73 0.735718055 0.250 0.4375 0.76791809 Ausente PA FI
## 74 -0.595431883 0.625 0.5625 0.82935154 Presente PA FI
## 75 0.735718055 0.875 0.5000 0.86006826 Presente PA FI
## 76 1.206326618 0.250 0.5625 1.00000000 Ausente PA FI
## 77 1.031529152 0.500 0.6250 0.44368601 Presente PA FO
## 78 0.345785245 0.625 0.5000 0.43344710 Presente PA FI
## 79 0.144095860 0.875 0.9375 0.46757679 Presente PA FI
## 80 0.587812506 0.750 0.5625 0.71331058 Ausente PA FI
## 81 -0.797121267 0.625 0.9375 0.10238908 Presente MA FI
## 82 0.923961480 0.750 0.5000 0.40273038 Ausente MA FI
## 83 -2.087933328 0.875 0.3750 0.80546075 Presente MA FI
## 84 -0.272728868 0.875 0.6875 0.26621160 Presente MA FO
## 85 0.937407439 0.250 0.3750 0.59726962 Presente MA FI
## 86 1.596259428 0.500 0.5625 0.02730375 Presente MA FI
## 87 -1.550094969 0.875 0.5625 0.38566553 Presente MA FI
## 88 -0.904688939 0.875 0.9375 0.19453925 Ausente MA FI
## 89 -1.106378323 0.000 0.4375 0.84300341 Ausente MA FO
## 90 0.413015040 0.500 0.6250 0.84641638 Presente MA FO
## 91 -0.931580857 0.750 0.4375 0.83276451 Presente MA FI
## 92 0.023082230 0.875 0.8750 0.62116041 Presente MA FI
## 93 0.345785245 1.000 0.4375 0.65529010 Presente MA FI
## 94 -1.334959626 0.625 0.6875 0.25255973 Presente MA FI
## 95 -0.447526334 0.250 0.6250 0.20819113 Presente MA FO
## 96 0.762609973 0.875 0.3125 0.86006826 Presente MA FO
## 97 1.004637234 0.625 0.4375 0.33105802 Presente MA FI
## 98 0.856731685 0.625 0.3125 0.26621160 Presente MA FO
## 99 -0.272728868 0.625 0.8125 0.90102389 Presente MA FI
## 100 0.063420106 0.875 0.4375 0.88054608 Presente MA FI
## 101 1.152542783 0.500 0.5000 0.97952218 Presente MA FI
## 102 -0.783675308 0.750 0.5625 0.37201365 Presente MA FI
## 103 0.574366547 0.625 0.8750 0.00000000 Presente MA FO
## 104 0.278555450 1.000 0.6875 0.28327645 Presente MA FO
## 105 0.117203942 0.750 0.6875 0.37201365 Ausente MA FI
## 106 -0.676107637 0.375 0.4375 0.67918089 Presente MA FO
## 107 0.453352916 0.750 0.5000 0.02389078 Presente MA FI
## 108 -0.313066745 0.625 0.7500 0.54607509 Presente MA FI
## 109 0.695380178 0.625 0.7500 0.73378840 Presente MA FI
## 110 1.219772577 0.875 0.4375 0.09215017 Ausente MA FI
## 111 1.757610936 0.750 0.4375 0.66211604 Presente MA FI
## 112 0.856731685 0.750 0.6875 0.71331058 Presente MA FO
## 113 -0.057593524 0.750 0.6875 0.24914676 Presente MA FO
## 114 0.964299357 0.500 0.0000 0.48464164 Ausente MA FO
## 115 -1.106378323 0.875 0.2500 0.87713311 Ausente MA FI
## 116 1.058421070 0.250 0.6250 0.92832765 Ausente MA FO
## 117 0.426460998 0.875 0.6250 0.76450512 Ausente MA FI
## 118 -1.200500036 0.750 0.6250 0.95221843 Presente MA FI
## 119 0.372677163 0.750 0.6875 0.34470990 Presente MA FI
## 120 0.776055932 0.750 0.6250 0.51877133 Presente MA FI
# Punto 10.17 Cree una nueva variable para tib.e donde divida el número de flores en las ramas con el número de flores desprendidas.
tib.e<- mutate(tib.e,"flores/divididas"=Flores.r/Flores.d)
tib.e
## Biomasa_gramos Flores.r Flores.d Hojas.d Plaga Estatus Fertilizacion
## 1 1.192880659 0.625 0.5000 0.01365188 Presente S FI
## 2 1.542475592 0.750 0.3750 0.63139932 Ausente S FI
## 3 0.628150383 0.375 0.5625 0.78498294 Presente S FI
## 4 0.681934219 0.750 0.6250 0.34812287 Presente S FI
## 5 -0.380296539 0.625 0.7500 0.66552901 Ausente S FI
## 6 0.170987778 0.750 0.8750 0.06825939 Presente S FO
## 7 -0.232390991 0.500 0.8125 0.76450512 Ausente S FI
## 8 0.372677163 0.625 0.4375 0.12969283 Presente S FO
## 9 1.192880659 1.000 0.4375 0.50511945 Presente S FO
## 10 -1.523203051 0.125 0.3750 0.56655290 Presente S FO
## 11 -0.837459144 0.750 0.2500 0.64163823 Presente S FO
## 12 0.197879696 0.625 0.7500 0.41638225 Presente S FO
## 13 -0.232390991 0.250 0.6250 0.52559727 Presente S FO
## 14 -0.649215719 0.875 0.6875 0.72013652 Presente S FO
## 15 0.170987778 0.375 0.5625 0.95904437 Presente S FI
## 16 -2.155163123 0.625 0.3750 0.72354949 Presente S FO
## 17 1.260110454 0.500 0.1250 0.06484642 Presente S FI
## 18 0.708826137 0.625 0.4375 0.66552901 Presente S FI
## 19 -1.536649010 0.500 0.5625 0.25255973 Ausente S FI
## 20 -0.541648047 0.750 0.6250 0.35836177 Presente S FO
## 21 0.883623603 0.625 0.5625 0.60068259 Presente S FO
## 22 1.165988741 0.375 0.3125 0.68259386 Presente S FI
## 23 -0.218945032 0.875 0.8750 0.01365188 Presente S FI
## 24 0.359231204 0.875 0.2500 0.90102389 Presente S FI
## 25 -0.581985924 0.250 0.4375 0.37201365 Presente S FO
## 26 -1.738338395 0.750 0.6250 0.52559727 Presente S FI
## 27 0.090312024 0.375 0.4375 0.83276451 Ausente S FI
## 28 0.049974147 0.625 0.5625 0.10921502 Ausente S FI
## 29 0.762609973 0.875 0.5000 0.34129693 Presente S FI
## 30 0.359231204 0.625 0.7500 0.26279863 Presente S FO
## 31 -0.608877842 0.250 0.5000 0.35836177 Presente S FO
## 32 -0.837459144 0.750 0.5625 0.58020478 Presente S FO
## 33 -0.366850580 0.625 0.6250 0.49829352 Presente S FO
## 34 1.260110454 0.750 0.5000 0.94197952 Presente S FI
## 35 0.009636271 0.500 0.5000 0.31399317 Presente S FI
## 36 -2.854352989 0.500 0.2500 0.68941980 Ausente S FO
## 37 0.480244834 0.875 0.4375 0.80887372 Presente S FI
## 38 1.650043264 0.500 0.5625 0.40273038 Presente S FO
## 39 -1.160162159 0.625 0.6250 0.94197952 Presente S FI
## 40 0.547474629 0.500 0.5000 0.94880546 Ausente S FO
## 41 -0.608877842 0.500 0.6250 0.81228669 Ausente PA FO
## 42 -0.729891472 0.125 0.5625 0.65870307 Presente PA FI
## 43 -0.945026816 0.625 0.1875 0.69965870 Presente PA FI
## 44 -0.716445513 0.875 0.3125 0.24914676 Ausente PA FO
## 45 -0.084485442 0.625 0.7500 0.38566553 Presente PA FI
## 46 -1.012256611 1.000 0.5625 0.15017065 Presente PA FO
## 47 -0.783675308 0.500 0.0625 0.63139932 Presente PA FO
## 48 0.964299357 0.750 0.4375 0.96928328 Presente PA FI
## 49 -0.339958662 0.250 0.3125 0.25255973 Presente PA FI
## 50 -0.259282909 1.000 0.6875 0.11262799 Presente PA FO
## 51 2.268557377 0.375 0.6250 0.03071672 Presente PA FI
## 52 0.117203942 0.875 0.5625 0.33788396 Ausente PA FI
## 53 2.134097787 0.750 0.9375 0.96928328 Presente PA FI
## 54 0.466798875 0.625 0.1875 0.30034130 Presente PA FI
## 55 -0.299620786 1.000 0.6875 0.36177474 Presente PA FO
## 56 -1.684554559 0.375 0.8125 0.25597270 Presente PA FI
## 57 -1.671108600 0.625 0.4375 0.26279863 Ausente PA FO
## 58 -0.111377360 0.750 0.5625 0.13651877 Presente PA FI
## 59 -1.133270241 0.250 0.5625 0.24573379 Ausente PA FO
## 60 0.897069562 0.750 0.2500 0.95563140 Presente PA FI
## 61 -1.200500036 1.000 0.2500 0.57679181 Presente PA FO
## 62 0.224771614 0.625 0.8125 0.93174061 Presente PA FI
## 63 -0.783675308 0.500 1.0000 0.75767918 Presente PA FI
## 64 0.238217573 0.875 0.1875 0.72013652 Ausente PA FI
## 65 -0.850905103 0.750 0.5625 0.32081911 Presente PA FI
## 66 -1.079486405 0.500 0.5000 0.15699659 Presente PA FO
## 67 -2.881244907 0.375 0.8750 0.75767918 Presente PA FO
## 68 1.569367510 0.875 0.7500 0.58020478 Presente PA FI
## 69 -0.218945032 0.750 0.5000 0.26279863 Presente PA FO
## 70 -0.407188457 0.625 0.3125 0.94197952 Presente PA FO
## 71 1.031529152 0.625 0.8125 0.71331058 Presente PA FO
## 72 0.628150383 0.875 0.3125 0.51877133 Presente PA FI
## 73 0.735718055 0.250 0.4375 0.76791809 Ausente PA FI
## 74 -0.595431883 0.625 0.5625 0.82935154 Presente PA FI
## 75 0.735718055 0.875 0.5000 0.86006826 Presente PA FI
## 76 1.206326618 0.250 0.5625 1.00000000 Ausente PA FI
## 77 1.031529152 0.500 0.6250 0.44368601 Presente PA FO
## 78 0.345785245 0.625 0.5000 0.43344710 Presente PA FI
## 79 0.144095860 0.875 0.9375 0.46757679 Presente PA FI
## 80 0.587812506 0.750 0.5625 0.71331058 Ausente PA FI
## 81 -0.797121267 0.625 0.9375 0.10238908 Presente MA FI
## 82 0.923961480 0.750 0.5000 0.40273038 Ausente MA FI
## 83 -2.087933328 0.875 0.3750 0.80546075 Presente MA FI
## 84 -0.272728868 0.875 0.6875 0.26621160 Presente MA FO
## 85 0.937407439 0.250 0.3750 0.59726962 Presente MA FI
## 86 1.596259428 0.500 0.5625 0.02730375 Presente MA FI
## 87 -1.550094969 0.875 0.5625 0.38566553 Presente MA FI
## 88 -0.904688939 0.875 0.9375 0.19453925 Ausente MA FI
## 89 -1.106378323 0.000 0.4375 0.84300341 Ausente MA FO
## 90 0.413015040 0.500 0.6250 0.84641638 Presente MA FO
## 91 -0.931580857 0.750 0.4375 0.83276451 Presente MA FI
## 92 0.023082230 0.875 0.8750 0.62116041 Presente MA FI
## 93 0.345785245 1.000 0.4375 0.65529010 Presente MA FI
## 94 -1.334959626 0.625 0.6875 0.25255973 Presente MA FI
## 95 -0.447526334 0.250 0.6250 0.20819113 Presente MA FO
## 96 0.762609973 0.875 0.3125 0.86006826 Presente MA FO
## 97 1.004637234 0.625 0.4375 0.33105802 Presente MA FI
## 98 0.856731685 0.625 0.3125 0.26621160 Presente MA FO
## 99 -0.272728868 0.625 0.8125 0.90102389 Presente MA FI
## 100 0.063420106 0.875 0.4375 0.88054608 Presente MA FI
## 101 1.152542783 0.500 0.5000 0.97952218 Presente MA FI
## 102 -0.783675308 0.750 0.5625 0.37201365 Presente MA FI
## 103 0.574366547 0.625 0.8750 0.00000000 Presente MA FO
## 104 0.278555450 1.000 0.6875 0.28327645 Presente MA FO
## 105 0.117203942 0.750 0.6875 0.37201365 Ausente MA FI
## 106 -0.676107637 0.375 0.4375 0.67918089 Presente MA FO
## 107 0.453352916 0.750 0.5000 0.02389078 Presente MA FI
## 108 -0.313066745 0.625 0.7500 0.54607509 Presente MA FI
## 109 0.695380178 0.625 0.7500 0.73378840 Presente MA FI
## 110 1.219772577 0.875 0.4375 0.09215017 Ausente MA FI
## 111 1.757610936 0.750 0.4375 0.66211604 Presente MA FI
## 112 0.856731685 0.750 0.6875 0.71331058 Presente MA FO
## 113 -0.057593524 0.750 0.6875 0.24914676 Presente MA FO
## 114 0.964299357 0.500 0.0000 0.48464164 Ausente MA FO
## 115 -1.106378323 0.875 0.2500 0.87713311 Ausente MA FI
## 116 1.058421070 0.250 0.6250 0.92832765 Ausente MA FO
## 117 0.426460998 0.875 0.6250 0.76450512 Ausente MA FI
## 118 -1.200500036 0.750 0.6250 0.95221843 Presente MA FI
## 119 0.372677163 0.750 0.6875 0.34470990 Presente MA FI
## 120 0.776055932 0.750 0.6250 0.51877133 Presente MA FI
## flores/divididas
## 1 1.2500000
## 2 2.0000000
## 3 0.6666667
## 4 1.2000000
## 5 0.8333333
## 6 0.8571429
## 7 0.6153846
## 8 1.4285714
## 9 2.2857143
## 10 0.3333333
## 11 3.0000000
## 12 0.8333333
## 13 0.4000000
## 14 1.2727273
## 15 0.6666667
## 16 1.6666667
## 17 4.0000000
## 18 1.4285714
## 19 0.8888889
## 20 1.2000000
## 21 1.1111111
## 22 1.2000000
## 23 1.0000000
## 24 3.5000000
## 25 0.5714286
## 26 1.2000000
## 27 0.8571429
## 28 1.1111111
## 29 1.7500000
## 30 0.8333333
## 31 0.5000000
## 32 1.3333333
## 33 1.0000000
## 34 1.5000000
## 35 1.0000000
## 36 2.0000000
## 37 2.0000000
## 38 0.8888889
## 39 1.0000000
## 40 1.0000000
## 41 0.8000000
## 42 0.2222222
## 43 3.3333333
## 44 2.8000000
## 45 0.8333333
## 46 1.7777778
## 47 8.0000000
## 48 1.7142857
## 49 0.8000000
## 50 1.4545455
## 51 0.6000000
## 52 1.5555556
## 53 0.8000000
## 54 3.3333333
## 55 1.4545455
## 56 0.4615385
## 57 1.4285714
## 58 1.3333333
## 59 0.4444444
## 60 3.0000000
## 61 4.0000000
## 62 0.7692308
## 63 0.5000000
## 64 4.6666667
## 65 1.3333333
## 66 1.0000000
## 67 0.4285714
## 68 1.1666667
## 69 1.5000000
## 70 2.0000000
## 71 0.7692308
## 72 2.8000000
## 73 0.5714286
## 74 1.1111111
## 75 1.7500000
## 76 0.4444444
## 77 0.8000000
## 78 1.2500000
## 79 0.9333333
## 80 1.3333333
## 81 0.6666667
## 82 1.5000000
## 83 2.3333333
## 84 1.2727273
## 85 0.6666667
## 86 0.8888889
## 87 1.5555556
## 88 0.9333333
## 89 0.0000000
## 90 0.8000000
## 91 1.7142857
## 92 1.0000000
## 93 2.2857143
## 94 0.9090909
## 95 0.4000000
## 96 2.8000000
## 97 1.4285714
## 98 2.0000000
## 99 0.7692308
## 100 2.0000000
## 101 1.0000000
## 102 1.3333333
## 103 0.7142857
## 104 1.4545455
## 105 1.0909091
## 106 0.8571429
## 107 1.5000000
## 108 0.8333333
## 109 0.8333333
## 110 2.0000000
## 111 1.7142857
## 112 1.0909091
## 113 1.0909091
## 114 Inf
## 115 3.5000000
## 116 0.4000000
## 117 1.4000000
## 118 1.2000000
## 119 1.0909091
## 120 1.2000000
# Punto 10.18 Seleccione solo la variable del cociente previo agrupada por plaga. Cree una nueva variable que imprima el rango mínimo en cada grupo. Llame a la variable rangomin
rangomin <- tib.e |>
group_by(Plaga) |>
select(`flores/divididas`) |>
summarise(min_range = min(`flores/divididas`))
## Adding missing grouping variables: `Plaga`
rangomin
## # A tibble: 2 x 2
## Plaga min_range
## <chr> <dbl>
## 1 Ausente 0
## 2 Presente 0.222
# Punto 10.19 Renombre las variables asociadas a las flores a su gusto. Use (rename())
tib.e<- rename(tib.e, flores.ramas=Flores.r,flores.desprendidas=Flores.d)
tib.e
## Biomasa_gramos flores.ramas flores.desprendidas Hojas.d Plaga Estatus
## 1 1.192880659 0.625 0.5000 0.01365188 Presente S
## 2 1.542475592 0.750 0.3750 0.63139932 Ausente S
## 3 0.628150383 0.375 0.5625 0.78498294 Presente S
## 4 0.681934219 0.750 0.6250 0.34812287 Presente S
## 5 -0.380296539 0.625 0.7500 0.66552901 Ausente S
## 6 0.170987778 0.750 0.8750 0.06825939 Presente S
## 7 -0.232390991 0.500 0.8125 0.76450512 Ausente S
## 8 0.372677163 0.625 0.4375 0.12969283 Presente S
## 9 1.192880659 1.000 0.4375 0.50511945 Presente S
## 10 -1.523203051 0.125 0.3750 0.56655290 Presente S
## 11 -0.837459144 0.750 0.2500 0.64163823 Presente S
## 12 0.197879696 0.625 0.7500 0.41638225 Presente S
## 13 -0.232390991 0.250 0.6250 0.52559727 Presente S
## 14 -0.649215719 0.875 0.6875 0.72013652 Presente S
## 15 0.170987778 0.375 0.5625 0.95904437 Presente S
## 16 -2.155163123 0.625 0.3750 0.72354949 Presente S
## 17 1.260110454 0.500 0.1250 0.06484642 Presente S
## 18 0.708826137 0.625 0.4375 0.66552901 Presente S
## 19 -1.536649010 0.500 0.5625 0.25255973 Ausente S
## 20 -0.541648047 0.750 0.6250 0.35836177 Presente S
## 21 0.883623603 0.625 0.5625 0.60068259 Presente S
## 22 1.165988741 0.375 0.3125 0.68259386 Presente S
## 23 -0.218945032 0.875 0.8750 0.01365188 Presente S
## 24 0.359231204 0.875 0.2500 0.90102389 Presente S
## 25 -0.581985924 0.250 0.4375 0.37201365 Presente S
## 26 -1.738338395 0.750 0.6250 0.52559727 Presente S
## 27 0.090312024 0.375 0.4375 0.83276451 Ausente S
## 28 0.049974147 0.625 0.5625 0.10921502 Ausente S
## 29 0.762609973 0.875 0.5000 0.34129693 Presente S
## 30 0.359231204 0.625 0.7500 0.26279863 Presente S
## 31 -0.608877842 0.250 0.5000 0.35836177 Presente S
## 32 -0.837459144 0.750 0.5625 0.58020478 Presente S
## 33 -0.366850580 0.625 0.6250 0.49829352 Presente S
## 34 1.260110454 0.750 0.5000 0.94197952 Presente S
## 35 0.009636271 0.500 0.5000 0.31399317 Presente S
## 36 -2.854352989 0.500 0.2500 0.68941980 Ausente S
## 37 0.480244834 0.875 0.4375 0.80887372 Presente S
## 38 1.650043264 0.500 0.5625 0.40273038 Presente S
## 39 -1.160162159 0.625 0.6250 0.94197952 Presente S
## 40 0.547474629 0.500 0.5000 0.94880546 Ausente S
## 41 -0.608877842 0.500 0.6250 0.81228669 Ausente PA
## 42 -0.729891472 0.125 0.5625 0.65870307 Presente PA
## 43 -0.945026816 0.625 0.1875 0.69965870 Presente PA
## 44 -0.716445513 0.875 0.3125 0.24914676 Ausente PA
## 45 -0.084485442 0.625 0.7500 0.38566553 Presente PA
## 46 -1.012256611 1.000 0.5625 0.15017065 Presente PA
## 47 -0.783675308 0.500 0.0625 0.63139932 Presente PA
## 48 0.964299357 0.750 0.4375 0.96928328 Presente PA
## 49 -0.339958662 0.250 0.3125 0.25255973 Presente PA
## 50 -0.259282909 1.000 0.6875 0.11262799 Presente PA
## 51 2.268557377 0.375 0.6250 0.03071672 Presente PA
## 52 0.117203942 0.875 0.5625 0.33788396 Ausente PA
## 53 2.134097787 0.750 0.9375 0.96928328 Presente PA
## 54 0.466798875 0.625 0.1875 0.30034130 Presente PA
## 55 -0.299620786 1.000 0.6875 0.36177474 Presente PA
## 56 -1.684554559 0.375 0.8125 0.25597270 Presente PA
## 57 -1.671108600 0.625 0.4375 0.26279863 Ausente PA
## 58 -0.111377360 0.750 0.5625 0.13651877 Presente PA
## 59 -1.133270241 0.250 0.5625 0.24573379 Ausente PA
## 60 0.897069562 0.750 0.2500 0.95563140 Presente PA
## 61 -1.200500036 1.000 0.2500 0.57679181 Presente PA
## 62 0.224771614 0.625 0.8125 0.93174061 Presente PA
## 63 -0.783675308 0.500 1.0000 0.75767918 Presente PA
## 64 0.238217573 0.875 0.1875 0.72013652 Ausente PA
## 65 -0.850905103 0.750 0.5625 0.32081911 Presente PA
## 66 -1.079486405 0.500 0.5000 0.15699659 Presente PA
## 67 -2.881244907 0.375 0.8750 0.75767918 Presente PA
## 68 1.569367510 0.875 0.7500 0.58020478 Presente PA
## 69 -0.218945032 0.750 0.5000 0.26279863 Presente PA
## 70 -0.407188457 0.625 0.3125 0.94197952 Presente PA
## 71 1.031529152 0.625 0.8125 0.71331058 Presente PA
## 72 0.628150383 0.875 0.3125 0.51877133 Presente PA
## 73 0.735718055 0.250 0.4375 0.76791809 Ausente PA
## 74 -0.595431883 0.625 0.5625 0.82935154 Presente PA
## 75 0.735718055 0.875 0.5000 0.86006826 Presente PA
## 76 1.206326618 0.250 0.5625 1.00000000 Ausente PA
## 77 1.031529152 0.500 0.6250 0.44368601 Presente PA
## 78 0.345785245 0.625 0.5000 0.43344710 Presente PA
## 79 0.144095860 0.875 0.9375 0.46757679 Presente PA
## 80 0.587812506 0.750 0.5625 0.71331058 Ausente PA
## 81 -0.797121267 0.625 0.9375 0.10238908 Presente MA
## 82 0.923961480 0.750 0.5000 0.40273038 Ausente MA
## 83 -2.087933328 0.875 0.3750 0.80546075 Presente MA
## 84 -0.272728868 0.875 0.6875 0.26621160 Presente MA
## 85 0.937407439 0.250 0.3750 0.59726962 Presente MA
## 86 1.596259428 0.500 0.5625 0.02730375 Presente MA
## 87 -1.550094969 0.875 0.5625 0.38566553 Presente MA
## 88 -0.904688939 0.875 0.9375 0.19453925 Ausente MA
## 89 -1.106378323 0.000 0.4375 0.84300341 Ausente MA
## 90 0.413015040 0.500 0.6250 0.84641638 Presente MA
## 91 -0.931580857 0.750 0.4375 0.83276451 Presente MA
## 92 0.023082230 0.875 0.8750 0.62116041 Presente MA
## 93 0.345785245 1.000 0.4375 0.65529010 Presente MA
## 94 -1.334959626 0.625 0.6875 0.25255973 Presente MA
## 95 -0.447526334 0.250 0.6250 0.20819113 Presente MA
## 96 0.762609973 0.875 0.3125 0.86006826 Presente MA
## 97 1.004637234 0.625 0.4375 0.33105802 Presente MA
## 98 0.856731685 0.625 0.3125 0.26621160 Presente MA
## 99 -0.272728868 0.625 0.8125 0.90102389 Presente MA
## 100 0.063420106 0.875 0.4375 0.88054608 Presente MA
## 101 1.152542783 0.500 0.5000 0.97952218 Presente MA
## 102 -0.783675308 0.750 0.5625 0.37201365 Presente MA
## 103 0.574366547 0.625 0.8750 0.00000000 Presente MA
## 104 0.278555450 1.000 0.6875 0.28327645 Presente MA
## 105 0.117203942 0.750 0.6875 0.37201365 Ausente MA
## 106 -0.676107637 0.375 0.4375 0.67918089 Presente MA
## 107 0.453352916 0.750 0.5000 0.02389078 Presente MA
## 108 -0.313066745 0.625 0.7500 0.54607509 Presente MA
## 109 0.695380178 0.625 0.7500 0.73378840 Presente MA
## 110 1.219772577 0.875 0.4375 0.09215017 Ausente MA
## 111 1.757610936 0.750 0.4375 0.66211604 Presente MA
## 112 0.856731685 0.750 0.6875 0.71331058 Presente MA
## 113 -0.057593524 0.750 0.6875 0.24914676 Presente MA
## 114 0.964299357 0.500 0.0000 0.48464164 Ausente MA
## 115 -1.106378323 0.875 0.2500 0.87713311 Ausente MA
## 116 1.058421070 0.250 0.6250 0.92832765 Ausente MA
## 117 0.426460998 0.875 0.6250 0.76450512 Ausente MA
## 118 -1.200500036 0.750 0.6250 0.95221843 Presente MA
## 119 0.372677163 0.750 0.6875 0.34470990 Presente MA
## 120 0.776055932 0.750 0.6250 0.51877133 Presente MA
## Fertilizacion flores/divididas
## 1 FI 1.2500000
## 2 FI 2.0000000
## 3 FI 0.6666667
## 4 FI 1.2000000
## 5 FI 0.8333333
## 6 FO 0.8571429
## 7 FI 0.6153846
## 8 FO 1.4285714
## 9 FO 2.2857143
## 10 FO 0.3333333
## 11 FO 3.0000000
## 12 FO 0.8333333
## 13 FO 0.4000000
## 14 FO 1.2727273
## 15 FI 0.6666667
## 16 FO 1.6666667
## 17 FI 4.0000000
## 18 FI 1.4285714
## 19 FI 0.8888889
## 20 FO 1.2000000
## 21 FO 1.1111111
## 22 FI 1.2000000
## 23 FI 1.0000000
## 24 FI 3.5000000
## 25 FO 0.5714286
## 26 FI 1.2000000
## 27 FI 0.8571429
## 28 FI 1.1111111
## 29 FI 1.7500000
## 30 FO 0.8333333
## 31 FO 0.5000000
## 32 FO 1.3333333
## 33 FO 1.0000000
## 34 FI 1.5000000
## 35 FI 1.0000000
## 36 FO 2.0000000
## 37 FI 2.0000000
## 38 FO 0.8888889
## 39 FI 1.0000000
## 40 FO 1.0000000
## 41 FO 0.8000000
## 42 FI 0.2222222
## 43 FI 3.3333333
## 44 FO 2.8000000
## 45 FI 0.8333333
## 46 FO 1.7777778
## 47 FO 8.0000000
## 48 FI 1.7142857
## 49 FI 0.8000000
## 50 FO 1.4545455
## 51 FI 0.6000000
## 52 FI 1.5555556
## 53 FI 0.8000000
## 54 FI 3.3333333
## 55 FO 1.4545455
## 56 FI 0.4615385
## 57 FO 1.4285714
## 58 FI 1.3333333
## 59 FO 0.4444444
## 60 FI 3.0000000
## 61 FO 4.0000000
## 62 FI 0.7692308
## 63 FI 0.5000000
## 64 FI 4.6666667
## 65 FI 1.3333333
## 66 FO 1.0000000
## 67 FO 0.4285714
## 68 FI 1.1666667
## 69 FO 1.5000000
## 70 FO 2.0000000
## 71 FO 0.7692308
## 72 FI 2.8000000
## 73 FI 0.5714286
## 74 FI 1.1111111
## 75 FI 1.7500000
## 76 FI 0.4444444
## 77 FO 0.8000000
## 78 FI 1.2500000
## 79 FI 0.9333333
## 80 FI 1.3333333
## 81 FI 0.6666667
## 82 FI 1.5000000
## 83 FI 2.3333333
## 84 FO 1.2727273
## 85 FI 0.6666667
## 86 FI 0.8888889
## 87 FI 1.5555556
## 88 FI 0.9333333
## 89 FO 0.0000000
## 90 FO 0.8000000
## 91 FI 1.7142857
## 92 FI 1.0000000
## 93 FI 2.2857143
## 94 FI 0.9090909
## 95 FO 0.4000000
## 96 FO 2.8000000
## 97 FI 1.4285714
## 98 FO 2.0000000
## 99 FI 0.7692308
## 100 FI 2.0000000
## 101 FI 1.0000000
## 102 FI 1.3333333
## 103 FO 0.7142857
## 104 FO 1.4545455
## 105 FI 1.0909091
## 106 FO 0.8571429
## 107 FI 1.5000000
## 108 FI 0.8333333
## 109 FI 0.8333333
## 110 FI 2.0000000
## 111 FI 1.7142857
## 112 FO 1.0909091
## 113 FO 1.0909091
## 114 FO Inf
## 115 FI 3.5000000
## 116 FO 0.4000000
## 117 FI 1.4000000
## 118 FI 1.2000000
## 119 FI 1.0909091
## 120 FI 1.2000000
# Punto 10.20 Pase a mayúsculas todos los nombres de las variables en cualquier tibble.
tib.e <- select_all(tib.e, toupper); names(tib.e)
## [1] "BIOMASA_GRAMOS" "FLORES.RAMAS" "FLORES.DESPRENDIDAS"
## [4] "HOJAS.D" "PLAGA" "ESTATUS"
## [7] "FERTILIZACION" "FLORES/DIVIDIDAS"
tib.e
## BIOMASA_GRAMOS FLORES.RAMAS FLORES.DESPRENDIDAS HOJAS.D PLAGA ESTATUS
## 1 1.192880659 0.625 0.5000 0.01365188 Presente S
## 2 1.542475592 0.750 0.3750 0.63139932 Ausente S
## 3 0.628150383 0.375 0.5625 0.78498294 Presente S
## 4 0.681934219 0.750 0.6250 0.34812287 Presente S
## 5 -0.380296539 0.625 0.7500 0.66552901 Ausente S
## 6 0.170987778 0.750 0.8750 0.06825939 Presente S
## 7 -0.232390991 0.500 0.8125 0.76450512 Ausente S
## 8 0.372677163 0.625 0.4375 0.12969283 Presente S
## 9 1.192880659 1.000 0.4375 0.50511945 Presente S
## 10 -1.523203051 0.125 0.3750 0.56655290 Presente S
## 11 -0.837459144 0.750 0.2500 0.64163823 Presente S
## 12 0.197879696 0.625 0.7500 0.41638225 Presente S
## 13 -0.232390991 0.250 0.6250 0.52559727 Presente S
## 14 -0.649215719 0.875 0.6875 0.72013652 Presente S
## 15 0.170987778 0.375 0.5625 0.95904437 Presente S
## 16 -2.155163123 0.625 0.3750 0.72354949 Presente S
## 17 1.260110454 0.500 0.1250 0.06484642 Presente S
## 18 0.708826137 0.625 0.4375 0.66552901 Presente S
## 19 -1.536649010 0.500 0.5625 0.25255973 Ausente S
## 20 -0.541648047 0.750 0.6250 0.35836177 Presente S
## 21 0.883623603 0.625 0.5625 0.60068259 Presente S
## 22 1.165988741 0.375 0.3125 0.68259386 Presente S
## 23 -0.218945032 0.875 0.8750 0.01365188 Presente S
## 24 0.359231204 0.875 0.2500 0.90102389 Presente S
## 25 -0.581985924 0.250 0.4375 0.37201365 Presente S
## 26 -1.738338395 0.750 0.6250 0.52559727 Presente S
## 27 0.090312024 0.375 0.4375 0.83276451 Ausente S
## 28 0.049974147 0.625 0.5625 0.10921502 Ausente S
## 29 0.762609973 0.875 0.5000 0.34129693 Presente S
## 30 0.359231204 0.625 0.7500 0.26279863 Presente S
## 31 -0.608877842 0.250 0.5000 0.35836177 Presente S
## 32 -0.837459144 0.750 0.5625 0.58020478 Presente S
## 33 -0.366850580 0.625 0.6250 0.49829352 Presente S
## 34 1.260110454 0.750 0.5000 0.94197952 Presente S
## 35 0.009636271 0.500 0.5000 0.31399317 Presente S
## 36 -2.854352989 0.500 0.2500 0.68941980 Ausente S
## 37 0.480244834 0.875 0.4375 0.80887372 Presente S
## 38 1.650043264 0.500 0.5625 0.40273038 Presente S
## 39 -1.160162159 0.625 0.6250 0.94197952 Presente S
## 40 0.547474629 0.500 0.5000 0.94880546 Ausente S
## 41 -0.608877842 0.500 0.6250 0.81228669 Ausente PA
## 42 -0.729891472 0.125 0.5625 0.65870307 Presente PA
## 43 -0.945026816 0.625 0.1875 0.69965870 Presente PA
## 44 -0.716445513 0.875 0.3125 0.24914676 Ausente PA
## 45 -0.084485442 0.625 0.7500 0.38566553 Presente PA
## 46 -1.012256611 1.000 0.5625 0.15017065 Presente PA
## 47 -0.783675308 0.500 0.0625 0.63139932 Presente PA
## 48 0.964299357 0.750 0.4375 0.96928328 Presente PA
## 49 -0.339958662 0.250 0.3125 0.25255973 Presente PA
## 50 -0.259282909 1.000 0.6875 0.11262799 Presente PA
## 51 2.268557377 0.375 0.6250 0.03071672 Presente PA
## 52 0.117203942 0.875 0.5625 0.33788396 Ausente PA
## 53 2.134097787 0.750 0.9375 0.96928328 Presente PA
## 54 0.466798875 0.625 0.1875 0.30034130 Presente PA
## 55 -0.299620786 1.000 0.6875 0.36177474 Presente PA
## 56 -1.684554559 0.375 0.8125 0.25597270 Presente PA
## 57 -1.671108600 0.625 0.4375 0.26279863 Ausente PA
## 58 -0.111377360 0.750 0.5625 0.13651877 Presente PA
## 59 -1.133270241 0.250 0.5625 0.24573379 Ausente PA
## 60 0.897069562 0.750 0.2500 0.95563140 Presente PA
## 61 -1.200500036 1.000 0.2500 0.57679181 Presente PA
## 62 0.224771614 0.625 0.8125 0.93174061 Presente PA
## 63 -0.783675308 0.500 1.0000 0.75767918 Presente PA
## 64 0.238217573 0.875 0.1875 0.72013652 Ausente PA
## 65 -0.850905103 0.750 0.5625 0.32081911 Presente PA
## 66 -1.079486405 0.500 0.5000 0.15699659 Presente PA
## 67 -2.881244907 0.375 0.8750 0.75767918 Presente PA
## 68 1.569367510 0.875 0.7500 0.58020478 Presente PA
## 69 -0.218945032 0.750 0.5000 0.26279863 Presente PA
## 70 -0.407188457 0.625 0.3125 0.94197952 Presente PA
## 71 1.031529152 0.625 0.8125 0.71331058 Presente PA
## 72 0.628150383 0.875 0.3125 0.51877133 Presente PA
## 73 0.735718055 0.250 0.4375 0.76791809 Ausente PA
## 74 -0.595431883 0.625 0.5625 0.82935154 Presente PA
## 75 0.735718055 0.875 0.5000 0.86006826 Presente PA
## 76 1.206326618 0.250 0.5625 1.00000000 Ausente PA
## 77 1.031529152 0.500 0.6250 0.44368601 Presente PA
## 78 0.345785245 0.625 0.5000 0.43344710 Presente PA
## 79 0.144095860 0.875 0.9375 0.46757679 Presente PA
## 80 0.587812506 0.750 0.5625 0.71331058 Ausente PA
## 81 -0.797121267 0.625 0.9375 0.10238908 Presente MA
## 82 0.923961480 0.750 0.5000 0.40273038 Ausente MA
## 83 -2.087933328 0.875 0.3750 0.80546075 Presente MA
## 84 -0.272728868 0.875 0.6875 0.26621160 Presente MA
## 85 0.937407439 0.250 0.3750 0.59726962 Presente MA
## 86 1.596259428 0.500 0.5625 0.02730375 Presente MA
## 87 -1.550094969 0.875 0.5625 0.38566553 Presente MA
## 88 -0.904688939 0.875 0.9375 0.19453925 Ausente MA
## 89 -1.106378323 0.000 0.4375 0.84300341 Ausente MA
## 90 0.413015040 0.500 0.6250 0.84641638 Presente MA
## 91 -0.931580857 0.750 0.4375 0.83276451 Presente MA
## 92 0.023082230 0.875 0.8750 0.62116041 Presente MA
## 93 0.345785245 1.000 0.4375 0.65529010 Presente MA
## 94 -1.334959626 0.625 0.6875 0.25255973 Presente MA
## 95 -0.447526334 0.250 0.6250 0.20819113 Presente MA
## 96 0.762609973 0.875 0.3125 0.86006826 Presente MA
## 97 1.004637234 0.625 0.4375 0.33105802 Presente MA
## 98 0.856731685 0.625 0.3125 0.26621160 Presente MA
## 99 -0.272728868 0.625 0.8125 0.90102389 Presente MA
## 100 0.063420106 0.875 0.4375 0.88054608 Presente MA
## 101 1.152542783 0.500 0.5000 0.97952218 Presente MA
## 102 -0.783675308 0.750 0.5625 0.37201365 Presente MA
## 103 0.574366547 0.625 0.8750 0.00000000 Presente MA
## 104 0.278555450 1.000 0.6875 0.28327645 Presente MA
## 105 0.117203942 0.750 0.6875 0.37201365 Ausente MA
## 106 -0.676107637 0.375 0.4375 0.67918089 Presente MA
## 107 0.453352916 0.750 0.5000 0.02389078 Presente MA
## 108 -0.313066745 0.625 0.7500 0.54607509 Presente MA
## 109 0.695380178 0.625 0.7500 0.73378840 Presente MA
## 110 1.219772577 0.875 0.4375 0.09215017 Ausente MA
## 111 1.757610936 0.750 0.4375 0.66211604 Presente MA
## 112 0.856731685 0.750 0.6875 0.71331058 Presente MA
## 113 -0.057593524 0.750 0.6875 0.24914676 Presente MA
## 114 0.964299357 0.500 0.0000 0.48464164 Ausente MA
## 115 -1.106378323 0.875 0.2500 0.87713311 Ausente MA
## 116 1.058421070 0.250 0.6250 0.92832765 Ausente MA
## 117 0.426460998 0.875 0.6250 0.76450512 Ausente MA
## 118 -1.200500036 0.750 0.6250 0.95221843 Presente MA
## 119 0.372677163 0.750 0.6875 0.34470990 Presente MA
## 120 0.776055932 0.750 0.6250 0.51877133 Presente MA
## FERTILIZACION FLORES/DIVIDIDAS
## 1 FI 1.2500000
## 2 FI 2.0000000
## 3 FI 0.6666667
## 4 FI 1.2000000
## 5 FI 0.8333333
## 6 FO 0.8571429
## 7 FI 0.6153846
## 8 FO 1.4285714
## 9 FO 2.2857143
## 10 FO 0.3333333
## 11 FO 3.0000000
## 12 FO 0.8333333
## 13 FO 0.4000000
## 14 FO 1.2727273
## 15 FI 0.6666667
## 16 FO 1.6666667
## 17 FI 4.0000000
## 18 FI 1.4285714
## 19 FI 0.8888889
## 20 FO 1.2000000
## 21 FO 1.1111111
## 22 FI 1.2000000
## 23 FI 1.0000000
## 24 FI 3.5000000
## 25 FO 0.5714286
## 26 FI 1.2000000
## 27 FI 0.8571429
## 28 FI 1.1111111
## 29 FI 1.7500000
## 30 FO 0.8333333
## 31 FO 0.5000000
## 32 FO 1.3333333
## 33 FO 1.0000000
## 34 FI 1.5000000
## 35 FI 1.0000000
## 36 FO 2.0000000
## 37 FI 2.0000000
## 38 FO 0.8888889
## 39 FI 1.0000000
## 40 FO 1.0000000
## 41 FO 0.8000000
## 42 FI 0.2222222
## 43 FI 3.3333333
## 44 FO 2.8000000
## 45 FI 0.8333333
## 46 FO 1.7777778
## 47 FO 8.0000000
## 48 FI 1.7142857
## 49 FI 0.8000000
## 50 FO 1.4545455
## 51 FI 0.6000000
## 52 FI 1.5555556
## 53 FI 0.8000000
## 54 FI 3.3333333
## 55 FO 1.4545455
## 56 FI 0.4615385
## 57 FO 1.4285714
## 58 FI 1.3333333
## 59 FO 0.4444444
## 60 FI 3.0000000
## 61 FO 4.0000000
## 62 FI 0.7692308
## 63 FI 0.5000000
## 64 FI 4.6666667
## 65 FI 1.3333333
## 66 FO 1.0000000
## 67 FO 0.4285714
## 68 FI 1.1666667
## 69 FO 1.5000000
## 70 FO 2.0000000
## 71 FO 0.7692308
## 72 FI 2.8000000
## 73 FI 0.5714286
## 74 FI 1.1111111
## 75 FI 1.7500000
## 76 FI 0.4444444
## 77 FO 0.8000000
## 78 FI 1.2500000
## 79 FI 0.9333333
## 80 FI 1.3333333
## 81 FI 0.6666667
## 82 FI 1.5000000
## 83 FI 2.3333333
## 84 FO 1.2727273
## 85 FI 0.6666667
## 86 FI 0.8888889
## 87 FI 1.5555556
## 88 FI 0.9333333
## 89 FO 0.0000000
## 90 FO 0.8000000
## 91 FI 1.7142857
## 92 FI 1.0000000
## 93 FI 2.2857143
## 94 FI 0.9090909
## 95 FO 0.4000000
## 96 FO 2.8000000
## 97 FI 1.4285714
## 98 FO 2.0000000
## 99 FI 0.7692308
## 100 FI 2.0000000
## 101 FI 1.0000000
## 102 FI 1.3333333
## 103 FO 0.7142857
## 104 FO 1.4545455
## 105 FI 1.0909091
## 106 FO 0.8571429
## 107 FI 1.5000000
## 108 FI 0.8333333
## 109 FI 0.8333333
## 110 FI 2.0000000
## 111 FI 1.7142857
## 112 FO 1.0909091
## 113 FO 1.0909091
## 114 FO Inf
## 115 FI 3.5000000
## 116 FO 0.4000000
## 117 FI 1.4000000
## 118 FI 1.2000000
## 119 FI 1.0909091
## 120 FI 1.2000000
# Punto 10.21 Seleccione la variable biomasa de la tableta con faltantes y con summarise() obtenga la media y el número de datos de esta variable.
# excluyendo los datos faltantes para poder dar el estadístico
tib.i |> select(Biomasa_gramos)|> summarise(mean= mean(tib.i$Biomasa_gramos, na.rm = T), n=n())
## mean n
## 1 4.905169 90
# Punto 10.22 Seleccione la variable biomasa de la tableta con faltantes y con summarise() obtenga la media y el n ́umero de datos por tipo de fertilización.
# QUITANDO LOS FALTANTES LA MEDIA SE PUEDE CALCULAR CUANDO LOS DEJO LA MEDIA QUEDA NA
tib.i |>
group_by(Fertilizacion) |> #select(Biomasa_gramos)|>
summarise(mean(Biomasa_gramos, na.rm = T), n=n())
## # A tibble: 2 x 3
## Fertilizacion `mean(Biomasa_gramos, na.rm = T)` n
## <chr> <dbl> <int>
## 1 FI 5.02 49
## 2 FO 4.77 41
# Punto 10.23 Seleccione la variable biomasa de la tableta con faltantes y con summarise() obtenga los cuantiles 0.10,0.20,0.30,0.40 y 0.50 por tipo de fertilización
tib.i |>
group_by(Fertilizacion) |>
summarise(quantile(Biomasa_gramos, na.rm = T, prob=c(0.10,0.20,0.30,0.4,0.5, group=NULL)))
## `summarise()` has grouped output by 'Fertilizacion'. You can override using the
## `.groups` argument.
## # A tibble: 10 x 2
## # Groups: Fertilizacion [2]
## Fertilizacion `quantile(...)`
## <chr> <dbl>
## 1 FI 4.03
## 2 FI 4.34
## 3 FI 4.78
## 4 FI 4.97
## 5 FI 5.11
## 6 FO 4.09
## 7 FO 4.31
## 8 FO 4.45
## 9 FO 4.53
## 10 FO 4.71
# Punto 10.24 Seleccione la variable biomasa de la tableta con faltantes y con summarise() obtenga la media, mediana, máximo, mínimo, desviación típica, desviación media, media truncada y varianza por tipo de fertilización y plaga.
tib.i |>
group_by(Fertilizacion,Plaga) |>
summarise(mean(Biomasa_gramos),median(Biomasa_gramos),min(Biomasa_gramos),max(Biomasa_gramos),sd(Biomasa_gramos),var(Biomasa_gramos),mean(Biomasa_gramos, trim=0.10), mad(Biomasa_gramos))
## `summarise()` has grouped output by 'Fertilizacion'. You can override using the
## `.groups` argument.
## # A tibble: 4 x 10
## # Groups: Fertilizacion [2]
## Fertilizacion Plaga `mean(Biomasa_gramo~` `median(Biomas~` `min(Biomasa_g~`
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 FI Ausente NA NA NA
## 2 FI Presente 4.99 5.06 3.38
## 3 FO Ausente 4.41 4.30 2.81
## 4 FO Presente 4.83 4.73 3.33
## # ... with 5 more variables: `max(Biomasa_gramos)` <dbl>,
## # `sd(Biomasa_gramos)` <dbl>, `var(Biomasa_gramos)` <dbl>,
## # `mean(Biomasa_gramos, trim = 0.1)` <dbl>, `mad(Biomasa_gramos)` <dbl>
# Punto 10.25 Seleccione la variable biomasa de la tableta con faltantes y con summarise() obtenga la media, mediana, máximo, mínimo, desviación típica, desviación media, media truncada y varianza por tipo de fertilización y plaga filtrando por plantas sanas.
#filtré por plantas afectadas "PA" y no por Sanas para poder incluir el dato faltante
library(dplyr)
tib.i |>
group_by(Fertilizacion,Plaga) |> filter(Estatus=="PA") |>
summarise(mean(Biomasa_gramos),median(Biomasa_gramos),min(Biomasa_gramos),max(Biomasa_gramos),sd(Biomasa_gramos),var(Biomasa_gramos),mean(Biomasa_gramos, trim=0.10), mad(Biomasa_gramos))
## `summarise()` has grouped output by 'Fertilizacion'. You can override using the
## `.groups` argument.
## # A tibble: 4 x 10
## # Groups: Fertilizacion [2]
## Fertilizacion Plaga `mean(Biomasa_gramo~` `median(Biomas~` `min(Biomasa_g~`
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 FI Ausente 5.45 5.43 5.11
## 2 FI Presente 4.95 4.96 3.68
## 3 FO Ausente 4.28 4.28 4.09
## 4 FO Presente 4.70 4.67 4.04
## # ... with 5 more variables: `max(Biomasa_gramos)` <dbl>,
## # `sd(Biomasa_gramos)` <dbl>, `var(Biomasa_gramos)` <dbl>,
## # `mean(Biomasa_gramos, trim = 0.1)` <dbl>, `mad(Biomasa_gramos)` <dbl>
# Punto 10.26 Con la tableta con faltantes use la función dropna() para sacar los faltantes y compare las estadísticas obtenidas en el ítem anterior con y sin faltantes
tib.i_NA= tidyr::drop_na(data = tib.i)
tib.i_NA |>
group_by(Fertilizacion,Plaga) |> filter(Estatus=="PA") |>
summarise(mean(Biomasa_gramos),median(Biomasa_gramos),min(Biomasa_gramos),max(Biomasa_gramos),sd(Biomasa_gramos),var(Biomasa_gramos),mean(Biomasa_gramos, trim=0.10), mad(Biomasa_gramos))
## `summarise()` has grouped output by 'Fertilizacion'. You can override using the
## `.groups` argument.
## # A tibble: 4 x 10
## # Groups: Fertilizacion [2]
## Fertilizacion Plaga `mean(Biomasa_gramo~` `median(Biomas~` `min(Biomasa_g~`
## <chr> <chr> <dbl> <dbl> <dbl>
## 1 FI Ausente 5.45 5.43 5.11
## 2 FI Presente 4.95 4.96 3.68
## 3 FO Ausente 4.28 4.28 4.09
## 4 FO Presente 4.70 4.67 4.04
## # ... with 5 more variables: `max(Biomasa_gramos)` <dbl>,
## # `sd(Biomasa_gramos)` <dbl>, `var(Biomasa_gramos)` <dbl>,
## # `mean(Biomasa_gramos, trim = 0.1)` <dbl>, `mad(Biomasa_gramos)` <dbl>
# las estadísticas con datos faltantes no se me calcularon, cuando uso la función drop_na quita los faltantes y se calculas las estadísticas
# Punto 10.27 Filtre los datos seleccionando solo las plantas afectadas o muy afectadas. Use el operador %in %
tib.i%>%
filter(tib.i$Estatus%in%c("PA","MA"))
## Biomasa_gramos Flores.r Flores.d Hojas.d Plaga Estatus Fertilizacion
## 1 5.83 13 11 294 Ausente PA FI
## 2 3.94 16 13 75 Presente MA FI
## 3 5.57 17 13 210 Presente MA FO
## 4 5.70 15 12 131 Presente PA FO
## 5 4.63 16 7 277 Presente PA FO
## 6 4.87 16 14 114 Presente PA FI
## 7 5.51 17 12 153 Presente MA FI
## 8 3.78 18 11 114 Presente MA FI
## 9 4.68 13 7 75 Presente PA FI
## 10 5.48 13 9 226 Ausente PA FI
## 11 3.68 14 15 76 Presente PA FI
## 12 5.24 15 12 249 Presente MA FO
## 13 4.11 18 6 258 Ausente MA FI
## 14 5.10 16 15 274 Presente PA FI
## 15 5.79 15 10 288 Presente MA FI
## 16 4.34 16 17 31 Presente MA FI
## 17 4.09 13 11 73 Ausente PA FO
## 18 5.04 18 17 138 Presente PA FI
## 19 4.85 17 11 41 Presente PA FI
## 20 5.14 19 13 84 Presente MA FO
## 21 5.28 16 5 89 Presente PA FI
## 22 4.98 18 9 259 Presente MA FI
## 23 NA 18 12 225 Ausente MA FI
## 24 5.65 15 2 143 Ausente MA FO
## 25 4.39 12 11 194 Presente PA FI
## 26 4.04 19 6 170 Presente PA FO
## 27 4.48 15 12 239 Ausente PA FO
## 28 4.18 19 11 45 Presente PA FO
## 29 4.73 18 13 79 Presente MA FO
## 30 4.35 15 3 186 Presente PA FO
## 31 5.50 18 7 253 Presente MA FO
## 32 4.89 17 13 74 Presente MA FO
## 33 6.62 14 12 10 Presente PA FI
## 34 4.74 19 13 34 Presente PA FO
## 35 5.27 17 10 8 Presente MA FI
## 36 4.77 17 10 78 Presente PA FO
## 37 5.36 16 16 1 Presente MA FO
## 38 5.65 17 9 285 Presente PA FI
## 39 4.11 11 9 248 Ausente MA FO
## 40 5.62 17 10 119 Ausente MA FI
## 41 4.73 16 15 265 Presente MA FI
## 42 5.19 16 10 128 Presente PA FI
## 43 5.11 18 5 212 Ausente PA FI
## 44 3.38 18 8 237 Presente MA FI
## 45 4.95 18 16 183 Presente MA FI
## 46 4.35 17 11 110 Presente MA FI
## 47 5.63 13 8 176 Presente MA FI
## 48 4.60 13 12 62 Presente MA FO
## 49 4.43 14 9 200 Presente MA FO
## 50 5.37 17 11 210 Ausente PA FI
## 51 4.13 15 10 47 Presente PA FO
## 52 5.48 18 10 253 Presente PA FI
## 53 5.57 16 7 79 Presente MA FO
## 54 4.23 16 5 206 Presente PA FI
## 55 4.71 19 13 107 Presente PA FO
## 56 5.70 16 15 210 Presente PA FO
## 57 4.30 17 11 95 Presente PA FI
# Punto 10.28 Seleccione la tibble con faltantes y use complete.cases(.) para dejar por fuera los faltantes
tib.i[complete.cases(tib.i), ]
## Biomasa_gramos Flores.r Flores.d Hojas.d Plaga Estatus Fertilizacion
## 76 5.83 13 11 294 Ausente PA FI
## 94 3.94 16 13 75 Presente MA FI
## 112 5.57 17 13 210 Presente MA FO
## 77 5.70 15 12 131 Presente PA FO
## 70 4.63 16 7 277 Presente PA FO
## 45 4.87 16 14 114 Presente PA FI
## 120 5.51 17 12 153 Presente MA FI
## 25 4.50 13 9 110 Presente S FO
## 87 3.78 18 11 114 Presente MA FI
## 49 4.68 13 7 75 Presente PA FI
## 73 5.48 13 9 226 Ausente PA FI
## 20 4.53 17 12 106 Presente S FO
## 11 4.31 17 6 189 Presente S FO
## 56 3.68 14 15 76 Presente PA FI
## 90 5.24 15 12 249 Presente MA FO
## 115 4.11 18 6 258 Ausente MA FI
## 62 5.10 16 15 274 Presente PA FI
## 10 3.80 12 8 167 Presente S FO
## 101 5.79 15 10 288 Presente MA FI
## 81 4.34 16 17 31 Presente MA FI
## 59 4.09 13 11 73 Ausente PA FO
## 79 5.04 18 17 138 Presente PA FI
## 58 4.85 17 11 41 Presente PA FI
## 13 4.76 13 12 155 Presente S FO
## 24 5.20 18 6 265 Presente S FI
## 37 5.29 18 9 238 Presente S FI
## 104 5.14 19 13 84 Presente MA FO
## 54 5.28 16 5 89 Presente PA FI
## 100 4.98 18 9 259 Presente MA FI
## 114 5.65 15 2 143 Ausente MA FO
## 29 5.50 18 10 101 Presente S FI
## 16 3.33 16 8 213 Presente S FO
## 4 5.44 17 12 103 Presente S FI
## 42 4.39 12 11 194 Presente PA FI
## 61 4.04 19 6 170 Presente PA FO
## 41 4.48 15 12 239 Ausente PA FO
## 21 5.59 16 11 177 Presente S FO
## 32 4.31 17 11 171 Presente S FO
## 36 2.81 15 6 203 Ausente S FO
## 9 5.82 19 9 149 Presente S FO
## 46 4.18 19 11 45 Presente PA FO
## 2 6.08 17 8 186 Ausente S FI
## 84 4.73 18 13 79 Presente MA FO
## 47 4.35 15 3 186 Presente PA FO
## 1 5.82 16 10 5 Presente S FI
## 96 5.50 18 7 253 Presente MA FO
## 22 5.80 14 7 201 Presente S FI
## 113 4.89 17 13 74 Presente MA FO
## 51 6.62 14 12 10 Presente PA FI
## 3 5.40 14 11 231 Presente S FI
## 50 4.74 19 13 34 Presente PA FO
## 40 5.34 15 10 279 Ausente S FO
## 38 6.16 15 11 119 Presente S FO
## 107 5.27 17 10 8 Presente MA FI
## 18 5.46 16 9 196 Presente S FI
## 69 4.77 17 10 78 Presente PA FO
## 14 4.45 18 13 212 Presente S FO
## 8 5.21 16 9 39 Presente S FO
## 35 4.94 15 10 93 Presente S FI
## 103 5.36 16 16 1 Presente MA FO
## 48 5.65 17 9 285 Presente PA FI
## 89 4.11 11 9 248 Ausente MA FO
## 82 5.62 17 10 119 Ausente MA FI
## 99 4.73 16 15 265 Presente MA FI
## 28 4.97 16 11 33 Ausente S FI
## 78 5.19 16 10 128 Presente PA FI
## 64 5.11 18 5 212 Ausente PA FI
## 83 3.38 18 8 237 Presente MA FI
## 92 4.95 18 16 183 Presente MA FI
## 102 4.35 17 11 110 Presente MA FI
## 33 4.66 16 12 147 Presente S FO
## 85 5.63 13 8 176 Presente MA FI
## 95 4.60 13 12 62 Presente MA FO
## 39 4.07 16 12 277 Presente S FI
## 106 4.43 14 9 200 Presente MA FO
## 34 5.87 17 10 277 Presente S FI
## 15 5.06 14 11 282 Presente S FI
## 80 5.37 17 11 210 Ausente PA FI
## 66 4.13 15 10 47 Presente PA FO
## 19 3.79 15 11 75 Ausente S FI
## 75 5.48 18 10 253 Presente PA FI
## 23 4.77 18 16 5 Presente S FI
## 30 5.20 16 14 78 Presente S FO
## 98 5.57 16 7 79 Presente MA FO
## 43 4.23 16 5 206 Presente PA FI
## 55 4.71 19 13 107 Presente PA FO
## 71 5.70 16 15 210 Presente PA FO
## 65 4.30 17 11 95 Presente PA FI
# Punto 10.29 Elimine de cualquier tibble las columnas asociadas al conteo de flores
tib.c |> select(-Flores.r,-Flores.d)
## Biomasa_gramos Hojas.d Plaga Estatus Fertilizacion
## 1 5.82 5 Presente S FI
## 2 6.08 186 Ausente S FI
## 3 5.40 231 Presente S FI
## 4 5.44 103 Presente S FI
## 5 4.65 196 Ausente S FI
## 6 5.06 21 Presente S FO
## 7 4.76 225 Ausente S FI
## 8 5.21 39 Presente S FO
## 9 5.82 149 Presente S FO
## 10 3.80 167 Presente S FO
## 11 4.31 189 Presente S FO
## 12 5.08 123 Presente S FO
## 13 4.76 155 Presente S FO
## 14 4.45 212 Presente S FO
## 15 5.06 282 Presente S FI
## 16 3.33 213 Presente S FO
## 17 5.87 20 Presente S FI
## 18 5.46 196 Presente S FI
## 19 3.79 75 Ausente S FI
## 20 4.53 106 Presente S FO
## 21 5.59 177 Presente S FO
## 22 5.80 201 Presente S FI
## 23 4.77 5 Presente S FI
## 24 5.20 265 Presente S FI
## 25 4.50 110 Presente S FO
## 26 3.64 155 Presente S FI
## 27 5.00 245 Ausente S FI
## 28 4.97 33 Ausente S FI
## 29 5.50 101 Presente S FI
## 30 5.20 78 Presente S FO
## 31 4.48 106 Presente S FO
## 32 4.31 171 Presente S FO
## 33 4.66 147 Presente S FO
## 34 5.87 277 Presente S FI
## 35 4.94 93 Presente S FI
## 36 2.81 203 Ausente S FO
## 37 5.29 238 Presente S FI
## 38 6.16 119 Presente S FO
## 39 4.07 277 Presente S FI
## 40 5.34 279 Ausente S FO
## 41 4.48 239 Ausente PA FO
## 42 4.39 194 Presente PA FI
## 43 4.23 206 Presente PA FI
## 44 4.40 74 Ausente PA FO
## 45 4.87 114 Presente PA FI
## 46 4.18 45 Presente PA FO
## 47 4.35 186 Presente PA FO
## 48 5.65 285 Presente PA FI
## 49 4.68 75 Presente PA FI
## 50 4.74 34 Presente PA FO
## 51 6.62 10 Presente PA FI
## 52 5.02 100 Ausente PA FI
## 53 6.52 285 Presente PA FI
## 54 5.28 89 Presente PA FI
## 55 4.71 107 Presente PA FO
## 56 3.68 76 Presente PA FI
## 57 3.69 78 Ausente PA FO
## 58 4.85 41 Presente PA FI
## 59 4.09 73 Ausente PA FO
## 60 5.60 281 Presente PA FI
## 61 4.04 170 Presente PA FO
## 62 5.10 274 Presente PA FI
## 63 4.35 223 Presente PA FI
## 64 5.11 212 Ausente PA FI
## 65 4.30 95 Presente PA FI
## 66 4.13 47 Presente PA FO
## 67 2.79 223 Presente PA FO
## 68 6.10 171 Presente PA FI
## 69 4.77 78 Presente PA FO
## 70 4.63 277 Presente PA FO
## 71 5.70 210 Presente PA FO
## 72 5.40 153 Presente PA FI
## 73 5.48 226 Ausente PA FI
## 74 4.49 244 Presente PA FI
## 75 5.48 253 Presente PA FI
## 76 5.83 294 Ausente PA FI
## 77 5.70 131 Presente PA FO
## 78 5.19 128 Presente PA FI
## 79 5.04 138 Presente PA FI
## 80 5.37 210 Ausente PA FI
## 81 4.34 31 Presente MA FI
## 82 5.62 119 Ausente MA FI
## 83 3.38 237 Presente MA FI
## 84 4.73 79 Presente MA FO
## 85 5.63 176 Presente MA FI
## 86 6.12 9 Presente MA FI
## 87 3.78 114 Presente MA FI
## 88 4.26 58 Ausente MA FI
## 89 4.11 248 Ausente MA FO
## 90 5.24 249 Presente MA FO
## 91 4.24 245 Presente MA FI
## 92 4.95 183 Presente MA FI
## 93 5.19 193 Presente MA FI
## 94 3.94 75 Presente MA FI
## 95 4.60 62 Presente MA FO
## 96 5.50 253 Presente MA FO
## 97 5.68 98 Presente MA FI
## 98 5.57 79 Presente MA FO
## 99 4.73 265 Presente MA FI
## 100 4.98 259 Presente MA FI
## 101 5.79 288 Presente MA FI
## 102 4.35 110 Presente MA FI
## 103 5.36 1 Presente MA FO
## 104 5.14 84 Presente MA FO
## 105 5.02 110 Ausente MA FI
## 106 4.43 200 Presente MA FO
## 107 5.27 8 Presente MA FI
## 108 4.70 161 Presente MA FI
## 109 5.45 216 Presente MA FI
## 110 5.84 28 Ausente MA FI
## 111 6.24 195 Presente MA FI
## 112 5.57 210 Presente MA FO
## 113 4.89 74 Presente MA FO
## 114 5.65 143 Ausente MA FO
## 115 4.11 258 Ausente MA FI
## 116 5.72 273 Ausente MA FO
## 117 5.25 225 Ausente MA FI
## 118 4.04 280 Presente MA FI
## 119 5.21 102 Presente MA FI
## 120 5.51 153 Presente MA FI
# Punto 10.30 Seleccione de cualquier tibble las avriables que contengan la d. Use select(contains()) Reordene una tableta usando select(,everything()) colocando primero los conteos de flores
tib.i |> select(contains(".d"))
## Flores.d Hojas.d
## 76 11 294
## 94 13 75
## 112 13 210
## 77 12 131
## 70 7 277
## 45 14 114
## 120 12 153
## 25 9 110
## 87 11 114
## 49 7 75
## 73 9 226
## 20 12 106
## 11 6 189
## 56 15 76
## 90 12 249
## 115 6 258
## 62 15 274
## 10 8 167
## 101 10 288
## 81 17 31
## 59 11 73
## 79 17 138
## 58 11 41
## 13 12 155
## 24 6 265
## 37 9 238
## 104 13 84
## 54 5 89
## 100 9 259
## 117 12 225
## 114 2 143
## 29 10 101
## 16 8 213
## 4 12 103
## 42 11 194
## 61 6 170
## 41 12 239
## 21 11 177
## 32 11 171
## 36 6 203
## 9 9 149
## 46 11 45
## 2 8 186
## 84 13 79
## 47 3 186
## 1 10 5
## 96 7 253
## 22 7 201
## 113 13 74
## 51 12 10
## 3 11 231
## 50 13 34
## 40 10 279
## 38 11 119
## 107 10 8
## 18 9 196
## 69 10 78
## 14 13 212
## 8 9 39
## 35 10 93
## 103 16 1
## 48 9 285
## 89 9 248
## 82 10 119
## 99 15 265
## 28 11 33
## 78 10 128
## 64 5 212
## 83 8 237
## 92 16 183
## 102 11 110
## 33 12 147
## 85 8 176
## 95 12 62
## 39 12 277
## 106 9 200
## 34 10 277
## 15 11 282
## 80 11 210
## 31 NA 106
## 66 10 47
## 19 11 75
## 75 10 253
## 23 16 5
## 30 14 78
## 98 7 79
## 43 5 206
## 55 13 107
## 71 15 210
## 65 11 95
tib.c |>
select(contains("Flores"),everything(tib.c))
## Flores.r Flores.d Biomasa_gramos Hojas.d Plaga Estatus Fertilizacion
## 1 16 10 5.82 5 Presente S FI
## 2 17 8 6.08 186 Ausente S FI
## 3 14 11 5.40 231 Presente S FI
## 4 17 12 5.44 103 Presente S FI
## 5 16 14 4.65 196 Ausente S FI
## 6 17 16 5.06 21 Presente S FO
## 7 15 15 4.76 225 Ausente S FI
## 8 16 9 5.21 39 Presente S FO
## 9 19 9 5.82 149 Presente S FO
## 10 12 8 3.80 167 Presente S FO
## 11 17 6 4.31 189 Presente S FO
## 12 16 14 5.08 123 Presente S FO
## 13 13 12 4.76 155 Presente S FO
## 14 18 13 4.45 212 Presente S FO
## 15 14 11 5.06 282 Presente S FI
## 16 16 8 3.33 213 Presente S FO
## 17 15 4 5.87 20 Presente S FI
## 18 16 9 5.46 196 Presente S FI
## 19 15 11 3.79 75 Ausente S FI
## 20 17 12 4.53 106 Presente S FO
## 21 16 11 5.59 177 Presente S FO
## 22 14 7 5.80 201 Presente S FI
## 23 18 16 4.77 5 Presente S FI
## 24 18 6 5.20 265 Presente S FI
## 25 13 9 4.50 110 Presente S FO
## 26 17 12 3.64 155 Presente S FI
## 27 14 9 5.00 245 Ausente S FI
## 28 16 11 4.97 33 Ausente S FI
## 29 18 10 5.50 101 Presente S FI
## 30 16 14 5.20 78 Presente S FO
## 31 13 10 4.48 106 Presente S FO
## 32 17 11 4.31 171 Presente S FO
## 33 16 12 4.66 147 Presente S FO
## 34 17 10 5.87 277 Presente S FI
## 35 15 10 4.94 93 Presente S FI
## 36 15 6 2.81 203 Ausente S FO
## 37 18 9 5.29 238 Presente S FI
## 38 15 11 6.16 119 Presente S FO
## 39 16 12 4.07 277 Presente S FI
## 40 15 10 5.34 279 Ausente S FO
## 41 15 12 4.48 239 Ausente PA FO
## 42 12 11 4.39 194 Presente PA FI
## 43 16 5 4.23 206 Presente PA FI
## 44 18 7 4.40 74 Ausente PA FO
## 45 16 14 4.87 114 Presente PA FI
## 46 19 11 4.18 45 Presente PA FO
## 47 15 3 4.35 186 Presente PA FO
## 48 17 9 5.65 285 Presente PA FI
## 49 13 7 4.68 75 Presente PA FI
## 50 19 13 4.74 34 Presente PA FO
## 51 14 12 6.62 10 Presente PA FI
## 52 18 11 5.02 100 Ausente PA FI
## 53 17 17 6.52 285 Presente PA FI
## 54 16 5 5.28 89 Presente PA FI
## 55 19 13 4.71 107 Presente PA FO
## 56 14 15 3.68 76 Presente PA FI
## 57 16 9 3.69 78 Ausente PA FO
## 58 17 11 4.85 41 Presente PA FI
## 59 13 11 4.09 73 Ausente PA FO
## 60 17 6 5.60 281 Presente PA FI
## 61 19 6 4.04 170 Presente PA FO
## 62 16 15 5.10 274 Presente PA FI
## 63 15 18 4.35 223 Presente PA FI
## 64 18 5 5.11 212 Ausente PA FI
## 65 17 11 4.30 95 Presente PA FI
## 66 15 10 4.13 47 Presente PA FO
## 67 14 16 2.79 223 Presente PA FO
## 68 18 14 6.10 171 Presente PA FI
## 69 17 10 4.77 78 Presente PA FO
## 70 16 7 4.63 277 Presente PA FO
## 71 16 15 5.70 210 Presente PA FO
## 72 18 7 5.40 153 Presente PA FI
## 73 13 9 5.48 226 Ausente PA FI
## 74 16 11 4.49 244 Presente PA FI
## 75 18 10 5.48 253 Presente PA FI
## 76 13 11 5.83 294 Ausente PA FI
## 77 15 12 5.70 131 Presente PA FO
## 78 16 10 5.19 128 Presente PA FI
## 79 18 17 5.04 138 Presente PA FI
## 80 17 11 5.37 210 Ausente PA FI
## 81 16 17 4.34 31 Presente MA FI
## 82 17 10 5.62 119 Ausente MA FI
## 83 18 8 3.38 237 Presente MA FI
## 84 18 13 4.73 79 Presente MA FO
## 85 13 8 5.63 176 Presente MA FI
## 86 15 11 6.12 9 Presente MA FI
## 87 18 11 3.78 114 Presente MA FI
## 88 18 17 4.26 58 Ausente MA FI
## 89 11 9 4.11 248 Ausente MA FO
## 90 15 12 5.24 249 Presente MA FO
## 91 17 9 4.24 245 Presente MA FI
## 92 18 16 4.95 183 Presente MA FI
## 93 19 9 5.19 193 Presente MA FI
## 94 16 13 3.94 75 Presente MA FI
## 95 13 12 4.60 62 Presente MA FO
## 96 18 7 5.50 253 Presente MA FO
## 97 16 9 5.68 98 Presente MA FI
## 98 16 7 5.57 79 Presente MA FO
## 99 16 15 4.73 265 Presente MA FI
## 100 18 9 4.98 259 Presente MA FI
## 101 15 10 5.79 288 Presente MA FI
## 102 17 11 4.35 110 Presente MA FI
## 103 16 16 5.36 1 Presente MA FO
## 104 19 13 5.14 84 Presente MA FO
## 105 17 13 5.02 110 Ausente MA FI
## 106 14 9 4.43 200 Presente MA FO
## 107 17 10 5.27 8 Presente MA FI
## 108 16 14 4.70 161 Presente MA FI
## 109 16 14 5.45 216 Presente MA FI
## 110 18 9 5.84 28 Ausente MA FI
## 111 17 9 6.24 195 Presente MA FI
## 112 17 13 5.57 210 Presente MA FO
## 113 17 13 4.89 74 Presente MA FO
## 114 15 2 5.65 143 Ausente MA FO
## 115 18 6 4.11 258 Ausente MA FI
## 116 13 12 5.72 273 Ausente MA FO
## 117 18 12 5.25 225 Ausente MA FI
## 118 17 12 4.04 280 Presente MA FI
## 119 17 13 5.21 102 Presente MA FI
## 120 17 12 5.51 153 Presente MA FI