knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
library(ggplot2) library(dplyr)
set.seed(123) # Para que los resultados sean reproducibles humedad <- data.frame( tiempo = 1:10, valor = runif(10, min = 40, max = 80) # valores de 40% a 80% )
#Analisis Basico resumen <- humedad %>% summarise( promedio = mean(valor), minimo = min(valor), maximo = max(valor) )
resumen
head(humedad)
grafico_humedad <- ggplot(humedad, aes(x = tiempo, y = valor)) + geom_line(color = “blue”) + geom_point(color = “darkgreen”, size = 3) + labs( title = “Humedad del suelo (simulada)”, x = “Tiempo (horas)”, y = “Humedad (%)” ) + theme_minimal()
print(grafico_humedad) grid::grid.force()