# load libraries
suppressPackageStartupMessages({
  devtools::load_all()
  library(tidyverse)
  library(wmo)
  library(targets)
})

# resolve conflicts
conflicted::conflict_prefer("filter", "dplyr")

# set global chunk options
knitr::opts_chunk$set(
  echo = FALSE,
  fig.align = "center",
  message = FALSE,
  warning = FALSE,
  out.width = "49%"
)


options(knitr.table.format = function() {
  if (knitr::is_latex_output()) 
    "latex" else "html"
})

theme_set(theme_wmo(base_family = "Calibri"))
withr::with_dir(here::here(), {
  biomass_clean <- tar_read(biomass_clean)
  biomass <- tar_read(biomass)
  biomass_equations <- tar_read(biomass_equations)
})

\newpage

Overview

Contributions to cellular biomass were estimated from cell dry weight and previously estimated compositions.

Data

ggplot(biomass_clean) + 
  aes(x = as.factor(date), y = cell_mass) +
  facet_grid(~toupper(cell_type), scales = "free_x", space = "free_x") +
  geom_point(alpha = 0.5) +
  stat_summary(
    fun.data = "mean_se", 
    geom = "pointrange", 
    color = "red", 
    alpha = 0.8
  ) +
  labs(
    x = "Date", 
    y = "Cell mass (pg)"
  )
my_kable(
  biomass, 
  col.names = c("Cell type", "Biomass (pg/cell)"), 
  caption = "Biomass", 
  digits = 0
)

The biomass equations are:

biomass_equations %>% 
  select(cell_type, eq) %>% 
  my_kable(
    caption = "Biomass equations", 
    col.names = c("Cell Type", "Equation")
  ) %>% 
  kableExtra::column_spec(2, width = "6in")


oldhamlab/Copeland.2021.hypoxia.flux documentation built on Feb. 5, 2022, 8:31 p.m.