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
# remotes::install_github("ropensci/gistr") | |
pacman::p_load(tidyverse, gistr) | |
options(github.username = 'juanchiem') | |
gists('mineall') | |
gist("3690306a2f7d7b36ac251fd55cf05e09") %>% gist_save() %>% gist_open() | |
# Get country centroids--- | |
pacman::p_load(rgeos, rworldmap) | |
# get world map | |
wmap <- getMap(resolution="low") |
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
# Single station (Balcarce) - multiple seasons | |
years <- 2020:2021 | |
seasons <- paste0(years, "-06-30") | |
station <- c(121.255669, 14.16742) | |
seasons_wth <- | |
map( | |
.x = seasons, | |
.f = get_wth, |
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) | |
# Fake data | |
full_grid <- expand_grid( | |
gen = paste0("G", 1:3), | |
loc = paste0("L", 1:3), | |
season = paste0("S", 1:4) | |
) %>% | |
mutate(env = paste(loc, season)) | |
replications(~ gen * env, full_grid) |
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
```{r} | |
pacman::p_load(tidyverse) | |
``` | |
```{r, eval=FALSE} | |
dataURL <- "http://coopnecochea.com/web/download/lluvias/Lluvias-2021.xls" | |
download.file(dataURL, destfile=data) | |
``` |
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
#### 1. Sign up at GitHub.com ################################################ | |
## If you do not have a GitHub account, sign up here: | |
## https://github.com/join | |
# ---------------------------------------------------------------------------- | |
#### 2. Install git ########################################################## | |
## If you do not have git installed, please do so: |
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
dat <- data.frame( | |
stringsAsFactors = FALSE, | |
trt = c(2,2,2,2,2,2,2,10,10,10, | |
10,10,10,10,2,2,2,2,2,2,2,10,10,10,10,10, | |
10,10,2,2,2,2,2,2,2,10,10,10,10,10,10,10), | |
par = c("2_1","2_1","2_1","2_1", | |
"2_1","2_1","2_1","10_1","10_1","10_1","10_1","10_1", | |
"10_1","10_1","2_2","2_2","2_2","2_2","2_2","2_2", | |
"2_2","10_2","10_2","10_2","10_2","10_2","10_2", | |
"10_2","2_3","2_3","2_3","2_3","2_3","2_3","2_3", |
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) | |
# Establezcamos el periodo critico | |
plot_base <- ggplot(data = data.frame(t = 0), aes(x = t))+ | |
annotate("rect", xmin = 15, xmax = 40, | |
ymin = 0, ymax = 100, | |
alpha = .2)+ | |
labs(y="Incidencia %")+ | |
xlim(0,40) + |
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(quantreg) | |
library(dplyr) | |
library(lubridate) | |
library(stringr) | |
library(readr) | |
library(ggplot2) | |
library(devtools) | |
library(splines) | |
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
gg<-expand.grid(type=letters[1:4], year=2000:2004) | |
df<-data.frame(gg, emissions=runif(nrow(gg)*10)) | |
df %>% | |
ggplot() + | |
aes(x=year, y=emissions)+ | |
geom_line(stat = "summary", linetype= "dashed", fun=mean)+ | |
geom_line(stat = "summary", fun=mean, aes(col=type)) |
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(scholar) | |
# get from scholar profile urlafter "/citations?user=" and before "=en" | |
id_authorname <- "TQQzkCwAAAAJ&hl" | |
profile_authorname <- get_profile(id_authorname) | |
profile_authorname | |
library(googlesheets4) |