Skip to content

Commit

Permalink
Added carbon table demo
Browse files Browse the repository at this point in the history
  • Loading branch information
gilesknight committed Aug 19, 2021
1 parent 540768c commit 33bf344
Show file tree
Hide file tree
Showing 44 changed files with 12,887 additions and 11,972 deletions.
1,459 changes: 1,122 additions & 337 deletions docs/Carbon-1.html

Large diffs are not rendered by default.

616 changes: 308 additions & 308 deletions docs/DO-1.html

Large diffs are not rendered by default.

626 changes: 313 additions & 313 deletions docs/abbreviations.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/acid-sulfate-soils.html

Large diffs are not rendered by default.

728 changes: 364 additions & 364 deletions docs/aqueous-geochemistry.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/benthic-habitat-quality.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/bioactive-particles.html

Large diffs are not rendered by default.

744 changes: 372 additions & 372 deletions docs/bivalves.html

Large diffs are not rendered by default.

616 changes: 308 additions & 308 deletions docs/coupling-to-host-models.html

Large diffs are not rendered by default.

616 changes: 308 additions & 308 deletions docs/foreward.html

Large diffs are not rendered by default.

646 changes: 323 additions & 323 deletions docs/generic-utilities-functions.html

Large diffs are not rendered by default.

618 changes: 309 additions & 309 deletions docs/index.html

Large diffs are not rendered by default.

616 changes: 308 additions & 308 deletions docs/introduction.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/macroalgae.html

Large diffs are not rendered by default.

830 changes: 415 additions & 415 deletions docs/nitrogen.html

Large diffs are not rendered by default.

616 changes: 308 additions & 308 deletions docs/nomenclature.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/organic-matter.html

Large diffs are not rendered by default.

616 changes: 308 additions & 308 deletions docs/organisation-of-the-library-module-structure.html

Large diffs are not rendered by default.

696 changes: 348 additions & 348 deletions docs/pathogens-microbial-indicator-organisms.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/phosphorous.html

Large diffs are not rendered by default.

718 changes: 359 additions & 359 deletions docs/phytoplankton.html

Large diffs are not rendered by default.

616 changes: 308 additions & 308 deletions docs/preface.html

Large diffs are not rendered by default.

628 changes: 314 additions & 314 deletions docs/publications-25.html

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/reference-keys.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ fig:aed-sites
tab:vardatatypes
tab:modules
tab:modules2
tab:11-summary
eq:nitrogen1
eq:nitrogen2
fig:nitrogen-1
Expand Down Expand Up @@ -173,6 +174,7 @@ setup-configuration-2
case-studies-examples-2
case-study-2
publications-2
Carbon_1
contributors-3
overview-3
model-description-3
Expand Down
616 changes: 308 additions & 308 deletions docs/references.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/riparian-habitat-quality.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/riparian-vegetation.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/search_index.json

Large diffs are not rendered by default.

714 changes: 357 additions & 357 deletions docs/sediment-biogeochemistry.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/silica.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/soil-biogeochemistry.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/soil-hydrology.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/stable-isotopes.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/submerged-macrophytes.html

Large diffs are not rendered by default.

616 changes: 308 additions & 308 deletions docs/suspended-sediment.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/totals.html

Large diffs are not rendered by default.

616 changes: 308 additions & 308 deletions docs/tracers-water-age.html

Large diffs are not rendered by default.

674 changes: 337 additions & 337 deletions docs/zooplankton.html

Large diffs are not rendered by default.

39 changes: 38 additions & 1 deletion rmd/11-carbon.Rmd
Original file line number Diff line number Diff line change
@@ -1,10 +1,47 @@
# Carbon {#Carbon_1 -}
# Carbon {#Carbon_1 }

## Contributors
## Overview
## Model Description
### Process Descriptions
### Variable Summary

```{r 11-summary, echo=FALSE, message=FALSE, warning=FALSE}
library(knitr)
library(kableExtra)
library(readxl)
library(rmarkdown)
carbon <- read_excel('tables/carbonTable.xlsx', sheet = 3)
carbonGroups <- unique(carbon$Group)
carbon$`AED name` <- paste0("`",carbon$`AED name`,"`")
for(i in seq_along(carbon$Symbol)){
if(!is.na(carbon$Symbol[i])==TRUE){
carbon$Symbol[i] <- paste0("$$",carbon$Symbol[i],"$$")
} else {
carbon$Symbol[i] <- NA
}
}
kbl(carbon[,2:8], caption = "Carbon table", align = "l",) %>%
pack_rows(carbonGroups[1],
min(which(carbon$Group == carbonGroups[1])),
max(which(carbon$Group == carbonGroups[1])),
background = '#ebebeb') %>%
pack_rows(carbonGroups[2],
min(which(carbon$Group == carbonGroups[2])),
max(which(carbon$Group == carbonGroups[2])),
background = '#ebebeb') %>%
pack_rows(carbonGroups[3],
min(which(carbon$Group == carbonGroups[3])),
max(which(carbon$Group == carbonGroups[3])),
background = '#ebebeb') %>%
row_spec(0, background = "#14759e", bold = TRUE, color = "white") %>%
kable_styling(full_width = F,font_size = 12) %>%
scroll_box(width = "770px", height = "500px",
fixed_thead = FALSE)
```

### Parameter Summary
### Optional Module Links
### Feedbacks to the Host Model
Expand Down
75 changes: 51 additions & 24 deletions scripts/animatedPlotly/animatedPlotly.R
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
# They require PAR as a vector (x-axis) and then each equation has a parameter (I_K or I_S)
#
# Could we try to do 2 or 3 of these (Case 1 and Case 3)?
#
# We would range PAR (par_c) on the x-axis from 0 to 2000.
# y-axis (fI) would be 0 – 1
# I_K would be on a slider from 10 - 500.
library(plotly)
library(dplyr)

#case 1
# x = par_c/I_K
# fI = (par_c/I_K) / (1 + (par_c/I_K))

case1 <- data.frame(
par_c = double(),
I_K = double(),
fI = double()
)

for(i in seq(10, 500, by = 10)){
case1_temp <- data.frame(
par_c = seq(0, 2000, by = 10),
Expand All @@ -27,6 +16,20 @@ for(i in seq(10, 500, by = 10)){
case1 <- bind_rows(case1,case1_temp)
}

#case 4
case4 <- data.frame(
par_c = double(),
I_K = double(),
fI = double()
)
for(i in seq(10, 500, by = 10)){
case4_temp <- data.frame(
par_c = seq(0, 2000, by = 10),
I_K = i
)
case4_temp$fI <- tanh(case4_temp$par_c/case4_temp$I_K)
case4 <- bind_rows(case4,case4_temp)
}


#case 3
Expand All @@ -35,7 +38,6 @@ case3 <- data.frame(
I_K = double(),
fI = double()
)

for(i in seq(10, 500, by = 10)){
case3_temp <- data.frame(
par_c = seq(0, 2000, by = 10),
Expand All @@ -47,26 +49,51 @@ for(i in seq(10, 500, by = 10)){

#create plot
fig <- plot_ly()
fig <- fig %>% add_trace(
case1,
name="Case 1",
x = case1$par_c,
y = case1$fI,
#frame = case1$I_K,
hovertemplate = 'fI: %{y:.2f}<extra></extra>',
type = 'scatter',
mode = 'lines')
fig <- fig %>% add_trace(
case3,
name="case3",
name="Case 3",
x = case3$par_c,
y = case3$fI,
frame = case3$I_K,
#frame = case3$I_K,
hovertemplate = 'fI: %{y:.2f}<extra></extra>',
type = 'scatter',
mode = 'lines')
fig <- fig %>% add_trace(
case1,
name="case1",
x = case1$par_c,
y = case1$fI,
frame = case1$I_K,
case4,
name="Case 4",
x = case4$par_c,
y = case4$fI,
#frame = case4$I_K,
hovertemplate = 'fI: %{y:.2f}<extra></extra>',
type = 'scatter',
mode = 'lines')

fig <- fig %>%
animation_opts(
250, easing = "linear", redraw = FALSE
) %>%
config(displayModeBar = FALSE,
displaylogo = FALSE)
layout(
hovermode = "x unified",
xaxis = list(title='PAR C',hoverformat = "PAR C"),
yaxis = list(title='Light limitation (fI)'),
sliders = list(active = 2,
currentvalue = list(prefix = "Test: "),
pad = list(t = 10),

steps = list(1:10)))
# ) %>%
# animation_opts(
# 250, easing = "linear", redraw = FALSE
# ) %>%
# animation_slider(
# currentvalue = list(prefix = "I_K: ")
# ) %>%
# config(displayModeBar = FALSE,
# displaylogo = FALSE)
fig
64 changes: 64 additions & 0 deletions scripts/summaryTables.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
library(readxl)
library(kableExtra)
library(rmarkdown)
carbon <- read_excel('tables/carbonTable.xlsx', sheet = 3)
carbonGroups <- unique(carbon$Group)
carbon$`AED name` <- paste0("`",carbon$`AED name`,"`")

for(i in seq_along(carbon$Symbol)){
if(!is.na(carbon$Symbol[i])==TRUE){
carbon$Symbol[i] <- paste0("$$",carbon$Symbol[i],"$$")
} else {
carbon$Symbol[i] <- NA
}
}

kbl(carbon[,2:8], caption = "Carbon table") %>%
kable_paper("striped", full_width = F) %>%
pack_rows(carbonGroups[1],
min(which(carbon$Group == carbonGroups[1])),
max(which(carbon$Group == carbonGroups[1]))) %>%
pack_rows(carbonGroups[2],
min(which(carbon$Group == carbonGroups[2])),
max(which(carbon$Group == carbonGroups[2]))) %>%
pack_rows(carbonGroups[3],
min(which(carbon$Group == carbonGroups[3])),
max(which(carbon$Group == carbonGroups[3]))) %>%
row_spec(0, background = "#14759e", bold = TRUE, color = "white") %>%
kable_styling(full_width = F)



library(knitr)
library(kableExtra)
library(readxl)
library(rmarkdown)
carbon <- read_excel('tables/carbonTable.xlsx', sheet = 3)
carbonGroups <- unique(carbon$Group)
carbon$`AED name` <- paste0("`",carbon$`AED name`,"`")

for(i in seq_along(carbon$Symbol)){
if(!is.na(carbon$Symbol[i])==TRUE){
carbon$Symbol[i] <- paste0("$$",carbon$Symbol[i],"$$")
} else {
carbon$Symbol[i] <- NA
}
}

kbl(carbon[,2:8], caption = "Carbon table", align = "l",) %>%
pack_rows(carbonGroups[1],
min(which(carbon$Group == carbonGroups[1])),
max(which(carbon$Group == carbonGroups[1])),
background = '#ebebeb') %>%
pack_rows(carbonGroups[2],
min(which(carbon$Group == carbonGroups[2])),
max(which(carbon$Group == carbonGroups[2])),
background = '#ebebeb') %>%
pack_rows(carbonGroups[3],
min(which(carbon$Group == carbonGroups[3])),
max(which(carbon$Group == carbonGroups[3])),
background = '#ebebeb') %>%
row_spec(0, background = "#14759e", bold = TRUE, color = "white") %>%
kable_styling(full_width = F,font_size = 12) %>%
scroll_box(width = "770px", height = "500px",
fixed_thead = FALSE)
Binary file added tables/carbonTable.xlsx
Binary file not shown.
Binary file added tables/carbonTableOG.xlsx
Binary file not shown.
Binary file added tables/~$carbonTable.xlsx
Binary file not shown.

0 comments on commit 33bf344

Please sign in to comment.