Skip to content

Instantly share code, notes, and snippets.

View stineb's full-sized avatar

Benjamin Stocker stineb

View GitHub Profile
---
title: "Extract values from NetCDF"
author: "Beni Stocker"
date: "2025-02-20"
output: html_document
---
```{r}
library(tidyverse)
library(terra)
---
title: "Demo aggregate GeoTIFF"
author: "Beni Stocker"
date: "2025-02-19"
output: html_document
---
```{r}
library(terra)
library(stringr)
@stineb
stineb / tseries.Rmd
Created February 17, 2025 21:03
Time series, rolling means, and z-scores
---
title: "Time series and z-scores"
author: "Beni Stocker"
date: "2025-02-17"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
library(rphydro)
library(tidyverse)
library(reshape2)
kphio = 0.087; # quantum yield efficiency
ppfd = 300; # umol/m2/s
vpd = 1000; # Pa
co2 = 400; # ppm
elv = 0; # m.a.s.l.
fapar = 0.7; # fraction
@stineb
stineb / gini.Rmd
Created February 6, 2025 08:47
Demonstrating the calculation of the Gini index on GPP anomalies.
---
title: "GINI"
author: "Beni Stocker"
date: "2025-02-05"
output: html_document
---
```{r}
library(tidyverse)
library(FluxDataKit)
---
title: "Plots for my inaugural lecture"
author: "Beni Stocker"
date: "4/30/2019"
output:
html_document:
toc: true
toc_depth: 3
toc_float: true
---
@stineb
stineb / get_vpd_day_fluxnet2015.R
Last active May 16, 2019 14:45
Getting daytime VPD from the half-hourly FLUXNET 2015 datasets
get_vpd_day_fluxnet2015 <- function(dir){
## loop over all HH files in the directory 'dir'
out <- purrr::map( as.list(list.files(dir, pattern = "HH")),
~get_vpd_day_fluxnet2015_byfile(paste0(dir, .)))
return(out)
}
get_vpd_day_fluxnet2015_byfile <- function(filename_hh){
---
title: "World maps"
output:
html_document:
df_print: paged
---
```{r echo = FALSE, message = FALSE}
library(tidyverse)
library(sf)