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 <- | |
dat %>% | |
left_join(wind, by = c("field" = "FIELD")) %>% | |
mutate( | |
field = factor(field), | |
trap_coord_deg = case_when( | |
trap_coord == "N" ~ 0, | |
trap_coord == "NbE" ~ 11.25, | |
trap_coord == "NNE" ~ 22.5, | |
trap_coord == "NEbN" ~ 33.75, |
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
############################################################################## | |
# title : EPIRICE-sim-bs-lb.R; | |
# purpose : Install the epicrop package and simulate rice brown spot and | |
# rice leaf blast epidemics; | |
# producer : prepared by A. Sparks; | |
# last update : in Perth, WA, Australia, Jun 2021; | |
# inputs : na; | |
# outputs : leaf blast and brown spot model outputs of unmanaged disase | |
# epidemics; | |
# remarks : Prepared for Jean Fabrice Adanve; |
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("GSODR") | |
library("tidyr") | |
library("dplyr") | |
library("countrycode") | |
w <- get_GSOD(years = 1929:1931) | |
w <- | |
w %>% | |
group_by(CTRY, YEAR) %>% |
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
function leaf_wet(wth = wth, simple = TRUE) | |
rh = diurnal_rh( | |
doy = wth[, DOY], | |
rh = wth[, RHUM], | |
tmin = wth[, TMIN], | |
tmax = wth[, TMAX], | |
tmp = wth[, TEMP], | |
lat = wth[, LAT] |
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
#' Get weather data from NASA POWER API | |
#' | |
#' @param lonlat A numeric vector of geographic coordinates for a cell or region | |
#' entered as x, y coordinates. | |
#' @param dates A character vector of start and end dates in that order. | |
#' | |
#' @return A \code{\link[data.table]{data.table}} of weather data, dates and |
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("ggplot2") | |
library("ggthemes") | |
theme_set(theme_map()) | |
library("sf") | |
library("rnaturalearth") | |
library("rnaturalearthdata") | |
world <- ne_countries(scale = "medium", returnclass = "sf") | |
ctry <- world[world$name == "Philippines", ] |
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(dplyr) | |
library(ggplot2) | |
library(lubridate) | |
library(cranlogs) | |
library(janitor) | |
dl <- | |
cran_downloads( | |
package = c( | |
"bomrang", |
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(bomrang) | |
library(tidyverse) | |
library(theme.usq) | |
# Find stations ---------------------------------------------------------------- | |
# Find nearest stations for each area | |
# search https://www.latlong.net/ for the lat lon values of each location | |
# clermont |
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
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/ | |
# core | |
brew install coreutils | |
# key commands | |
brew install binutils | |
brew install diffutils | |
brew install ed | |
brew install findutils |
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
#' @title bibtex_2academic | |
#' @description import publications from a bibtex file to a hugo-academic website | |
#' @author Lorenzo Busetto, phD (2017) <lbusett@gmail.com> | |
bibtex_2academic <- function(bibfile, | |
outfold, | |
abstract = FALSE, | |
overwrite = FALSE) { | |
require(RefManageR) |