-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
88 lines (65 loc) · 2.43 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
output: github_document
---
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# sapfluxnetr
[![CRAN status](https://www.r-pkg.org/badges/version/sapfluxnetr)](https://CRAN.R-project.org/package=sapfluxnetr)
[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/sapfluxnetr?color=blue)](https://r-pkg.org/pkg/sapfluxnetr)
[![R build status](https://github.com/sapfluxnet/sapfluxnetr/workflows/R-CMD-check/badge.svg)](https://github.com/sapfluxnet/sapfluxnetr/actions)
`sapfluxnetr` provides tools for a tidy data analysis for the first global
database of sap flow measurements
([Sapfluxnet Project](http://sapfluxnet.creaf.cat))
## Examples
You can work with individual sites:
```{r example_single}
# load packages
library(sapfluxnetr)
library(ggplot2)
# ARG_MAZ example site data
data('ARG_MAZ', package = 'sapfluxnetr')
data('sfn_metadata_ex', package = 'sapfluxnetr')
# plot site sapflow measurements versus vpd
sfn_plot(ARG_MAZ, formula_env = ~ vpd)
# daily sapflow and environmental metrics
arg_maz_metrics <- daily_metrics(
ARG_MAZ, tidy = TRUE, metadata = sfn_metadata_ex
)
# plot daily aggregations
ggplot(arg_maz_metrics, aes(x = vpd_q_95, y = sapflow_q_95, colour = pl_code)) +
geom_point()
```
You can work with multiple sites also:
```{r example_multi}
# ARG_TRE and AUS_CAN_ST2_MIX example sites
data('ARG_TRE', package = 'sapfluxnetr')
data('AUS_CAN_ST2_MIX', package = 'sapfluxnetr')
multi_sfn <- sfn_data_multi(ARG_TRE, ARG_MAZ, AUS_CAN_ST2_MIX)
# plotting the individual sites. It creates a list of plots
plots_list <- sfn_plot(multi_sfn, formula_env = ~ vpd)
plots_list[['AUS_CAN_ST2_MIX']]
# daily sapflow standard metrics
multi_metrics <- daily_metrics(
multi_sfn, tidy = TRUE, metadata = sfn_metadata_ex
)
# plot daily aggregations
ggplot(multi_metrics, aes(x = vpd_q_95, y = sapflow_q_95, colour = si_code)) +
geom_point(alpha = 0.2)
```
## Installation
You can install sapfluxnetr from CRAN:
```{r cran-installation, eval = FALSE}
install.packages('sapfluxnetr')
```
Be advised, `sapfluxnetr` is in active development and can contain undiscovered
bugs. If you find something not working as expected fill a bug at
https://github.com/sapfluxnet/sapfluxnetr/issues
## Overview
Please see `vignette('sapfluxnetr-quick-guide', package = 'sapfluxnetr')` for
a detailed overview of the package capabilities.