This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gruesa <- format(ISOdate(2000, c(6:12,1:3), 1), "%B") | |
tibble::tribble( | |
~sitio, ~pp_agosto, ~pp_septiembre, ~pp_octubre, ~pp_noviembre, ~pp_diciembre, ~pp_enero, ~pp_febrero, ~pp_marzo, | |
"CHASCOMUS", 0, 0, 14L, 22L, 30L, 52L, 27L, 94L, | |
"RIVERA", 0, 50, 48L, 109L, 15L, 158L, 25L, 85L | |
) |> | |
pivot_longer(contains("pp"), | |
names_prefix = "pp_") |> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(googlesheets4) | |
link <- "https://docs.google.com/spreadsheets/d/1OXHDK2S2rc5pp-aGKaTwvP8bSdo5faa6YN8QGqGDl7U/edit?usp=sharing" | |
gs4_deauth() | |
meteo_eea <- gs4_get(link) | |
bce22 <- read_sheet(meteo_eea, sheet="2022") %>% | |
mutate(date = ymd(date)) | |
bce22 | |
# remotes::install_github("ropensci/chirps", build_vignettes = TRUE) | |
pacman::p_load(chirps, terra, tidyverse) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
# https://stats.stackexchange.com/questions/309047/zero-inflated-beta-regression-using-gamlss-for-vegetation-cover-data | |
# Since the data are percentages/proportions on the interval [0,1), | |
# I figured a zero inflated beta regression would be appropriate. | |
# I do this using the gamlss package in R: | |
df <- data.frame( | |
cover = c(0.0013,0,0.0208,0.0038,0,0,0,0.0043, | |
0,0.002,0.0068,0.0213,0,0.0069,0.0075,0,0,0,0.013, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pacman::p_load(tidyverse, sf, ggspatial, geodata) | |
# theme_set: background theme | |
theme_set(theme_bw()+ | |
theme( | |
panel.grid.major = element_line(color = gray(0.5), | |
linetype = "dashed", | |
linewidth = 0.1), | |
panel.background = element_rect(fill = "aliceblue"), | |
axis.text.x = element_text(size = 6), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Muy util para explorar diseños experimentales | |
library(tidyverse) | |
# Agregamos algun NA | |
wb <- warpbreaks %>% | |
add_row(breaks= c(rep(30,5), NA), wool= rep(c("A","B"), 3), tension=rep(c("L","M", "H"), 2)) | |
head(wb) | |
str(wb) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://agronomy4future.org/?p=17137 | |
pacman::p_load(tidyverse, nlraa, minpack.lm) | |
github <- "https://raw.githubusercontent.com/agronomy4future/raw_data_practice/main/sulphur%20application.csv" | |
dataA <- readr::read_csv(github) | |
# QUADRATIC PLATEAU | |
# to find reasonable initial values for parameters | |
fit.lm<-lm(yield ~ poly(sulphur,2, raw=TRUE),data=dataA) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(segmented) | |
library(tidyverse) | |
#view DataFrame | |
df <- data.frame(x=c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16), | |
y=c(2, 4, 5, 6, 8, 10, 12, 13, 15, 19, 24, 28, 31, 34, 39, 44)) | |
df2 <- data.frame(x=c(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)+2, | |
y=c(4, 5, 6, 8, 10, 12, 13, 15, 19, 24, 28, 31, 34, 39)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"https://tiagoolivoto.github.io/paper_pliman/code.html#batch-processing" | |
```{r} | |
# install.packages("BiocManager") | |
# BiocManager::install("EBImage") | |
# devtools::install_github("TiagoOlivoto/pliman") | |
pacman::p_load(tidyverse, pliman) | |
``` | |
1. Seleccione el working directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
dat <- tibble::tribble( | |
~precio_cereal, ~gasto_comer, ~ingreso_neto, ~`kg/$`, ~producto, ~costo_dosis, ~mosquito, ~costo_apli, ~rinde_obj, ~`pisada_%`, ~pisada_kg, ~costo_trat_kg, ~costo_tot_kg, | |
310L, 20L, 248, 4.03, "MD", 22L, 8.5, 30.5, 2500L, 2.5, 62.5, 123L, 185L, | |
310L, 20L, 248, 4.03, "MD", 22L, 8.5, 30.5, 3000L, 2.5, 75, 123L, 198L, | |
310L, 20L, 248, 4.03, "MD", 22L, 8.5, 30.5, 3500L, 2.5, 87.5, 123L, 210L, | |
310L, 20L, 248, 4.03, "MD", 22L, 8.5, 30.5, 4000L, 2.5, 100, 123L, 223L, | |
320L, 20L, 256, 3.91, "MD", 22L, 8.5, 30.5, 2500L, 2.5, 62.5, 119L, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
dat <- tibble::tribble( | |
~hj, ~a_1, ~a_2, ~a_3, ~a_4, ~a_5, ~c_1, ~c_2, ~c_3, ~c_4, ~c_5, | |
"hb", 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, | |
"hb-1", 0L, 0L, 0L, 0L, 0L, 0L, 0L, 2L, 1L, 3L, | |
"hb-2", 0L, 2L, 3L, 1L, 0L, 4L, 5L, 5L, 8L, 10L, | |
"hb-3", 3L, 7L, 3L, 5L, 7L, 2L, 8L, 14L, 14L, 10L | |
) |
NewerOlder