Skip to content
Snippets Groups Projects
Commit fc87ef96 authored by Fabian Stenzel's avatar Fabian Stenzel
Browse files

updaten vignette

parent 4650aa76
No related branches found
No related tags found
2 merge requests!6Merge reviewed package into main,!5Merge review_paper version to master
...@@ -627,9 +627,10 @@ calc_biocol <- function( ...@@ -627,9 +627,10 @@ calc_biocol <- function(
external_wood_harvest = FALSE, external_wood_harvest = FALSE,
grass_scaling = FALSE, grass_scaling = FALSE,
npp_threshold = 20, npp_threshold = 20,
grass_harvest_file = "grazing_data.RData", grass_harvest_file = NULL,
external_fire_file = "human_ignition_fraction.RData", external_fire_file = NULL,
external_wood_harvest_file = "wood_harvest_biomass_sum_1500-2014_67420.RData") { external_wood_harvest_file = NULL) {
metric_files <- system.file( metric_files <- system.file(
"extdata", "extdata",
"metric_files.yml", "metric_files.yml",
...@@ -665,6 +666,7 @@ calc_biocol <- function( ...@@ -665,6 +666,7 @@ calc_biocol <- function(
cftfrac = paste0(path_pnv, outputs$cftfrac$name, ".", file_extension), cftfrac = paste0(path_pnv, outputs$cftfrac$name, ".", file_extension),
fpc = paste0(path_pnv, outputs$fpc$name, ".", file_extension) fpc = paste0(path_pnv, outputs$fpc$name, ".", file_extension)
) )
if (is.null(reference_npp_file)) reference_npp_file <- files_baseline$npp
files_reference <- list( files_reference <- list(
npp = reference_npp_file npp = reference_npp_file
) )
......
...@@ -16,7 +16,6 @@ biocol <- biospheremetrics::calc_biocol( ...@@ -16,7 +16,6 @@ biocol <- biospheremetrics::calc_biocol(
start_year = 1500, start_year = 1500,
stop_year = 2016, stop_year = 2016,
reference_npp_time_span = 1510:1539, reference_npp_time_span = 1510:1539,
reference_npp_file = paste0(pnv_folder,"npp.bin.json"),
read_saved_data = FALSE, read_saved_data = FALSE,
save_data = FALSE save_data = FALSE
) )
......
...@@ -44,4 +44,21 @@ list_outputs(metric = "ecorisk_nitrogen") ...@@ -44,4 +44,21 @@ list_outputs(metric = "ecorisk_nitrogen")
list_outputs(metric = "ecorisk_nitrogen") list_outputs(metric = "ecorisk_nitrogen")
``` ```
Note that `starwars` is a tibble, a modern reimagining of the data frame. It's particularly useful for large datasets because it only prints the first few rows. You can learn more about tibbles at <https://tibble.tidyverse.org>; in particular you can convert data frames to tibbles with `as_tibble()`. ## Demo case
The package contains some demo LPJmL simulation data for two cells.
Define the folders for run (simulation with climate change and land-use) and
pnv (potential natural vegetation - climate change, but no land-use) and a
temporary output folder, if you want to test to write to files.
```{r}
run_folder <- paste0(system.file("extdata","run","lu_1500_2016",package = "biospheremetrics"),"/")
pnv_folder <- paste0(system.file("extdata","run","pnv_1500_2016",package = "biospheremetrics"),"/")
out_folder <- paste0(tempdir(),"/")
```
## BioCol
```{r}
```
```{r}
```
## Example use
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment