Skip to content

Commit

Permalink
Merge pull request #160 from geco-bern/patch-data-format-vignette
Browse files Browse the repository at this point in the history
basic data vignette
  • Loading branch information
khufkens committed Jul 25, 2023
2 parents bd02f11 + 65ca19a commit 328148c
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions vignettes/data_format.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "P-model data format"
author: "Koen Hufkens, Josefa Arán"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{P-model data format}
%\VignetteEngine{knitr::rmarkdown}
%\usepackage[utf8]{inputenc}
---

```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.align = "center",
fig.width = 7,
fig.height = 5
)
library(rsofun)
library(dplyr)
library(ggplot2)
```

Overall, the package uses the {tidyverse} data paradigm (Wickham, 2017), using nested data frames (tibbles) to store model input and output, and validation data. Where possible the package uses a consistent ontogeny in terms of variables and data structures used. Each site is defined by a site name (sitename), location specific site information (site_info), soil characteristics (params_soil), simulation parameter settings (params_siml) and environmental forcing data (forcing). Sites are grouped by row in a nested tibble.

```{r}
# call to the included p-model demo data
rsofun::p_model_drivers
```

Here, the forcing data contains environmental variables commonly available at fluxnet (reference) or ICOS atmospheric gas exchange measurement locations or gathered from various gridded or re-analysis sources. Data are provided at a daily time step and for complete years.

```{r}
# detailed look at the forcing data
rsofun::p_model_drivers$forcing
```

To create your own driver data it should be arranged into a tibble with the same structure as the example drivers objects. Within {rsofun} optional checks are executed to ensure that the required variables are present in the used dataset using the ‘check’ argument in the runread_pmodel_f() function calls. Throughout the package verbose output is provided (if desired) as to evaluate errors or progress when running the model on a particular dataset.

0 comments on commit 328148c

Please sign in to comment.