Skip to content

Commit

Permalink
Merge pull request #739 from mgondan/patch-1
Browse files Browse the repository at this point in the history
Fix a minor numeric inconsistency in the hector vignette
  • Loading branch information
kdorheim committed Apr 9, 2024
2 parents 7ba5172 + cb0dce9 commit 62d012b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions vignettes/hector.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ beta
The result of `fetchvars()` is always a `data.frame` with the same columns, even when returning a parameter value.
Note also the use of `NA` in the second argument (`dates`).

The current value is set to 0.36 (note that it is a unitless quantity, hence the `(unitless)` unit).
Let's bump it up a little to 0.40.
The current value is set to 0.53 (note that it is a unitless quantity, hence the `(unitless)` unit).
Let's bump it up a little to 0.60.

```{r set-beta }
setvar(core, NA, BETA(), 0.40, "(unitless)")
setvar(core, NA, BETA(), 0.60, "(unitless)")
```

Similarly to `run`, this returns no output.
Expand Down Expand Up @@ -176,16 +176,16 @@ We can now perform another run with the new CO$_2$ fertilization value.

```{r run-sim-2}
run(core)
results_40 <- fetchvars(core, 2000:2300)
head(results_40)
results_60 <- fetchvars(core, 2000:2300)
head(results_60)
```

Let's see how changing the CO$_2$ fertilization affects our results.

```{r compare-co2-fert }
results[["beta"]] <- 0.36
results_40[["beta"]] <- 0.40
compare_results <- rbind(results, results_40)
results[["beta"]] <- 0.53
results_60[["beta"]] <- 0.60
compare_results <- rbind(results, results_60)
ggplot(compare_results) +
aes(x = year, y = value, color = factor(beta)) +
Expand Down

0 comments on commit 62d012b

Please sign in to comment.