Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a minor numeric inconsistency in the hector vignette #739

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading