https://github.com/tom-n-walker/uphill-plants-soil-carbon
Revision 951e73295060ad88bddf5d48a3aa4b9d90475312 authored by Tom Walker on 07 September 2021, 14:32:36 UTC, committed by Tom Walker on 07 September 2021, 14:32:36 UTC
2 parent s 05e1672 + 5c297ab
Raw File
Tip revision: 951e73295060ad88bddf5d48a3aa4b9d90475312 authored by Tom Walker on 07 September 2021, 14:32:36 UTC
Merge branch 'main' of github.com:tom-n-walker/uphill-plants-soil-carbon into main
Tip revision: 951e732
drake_plan.R
################################################################################
#### Project: SNF field experiment
#### Title:   Drake plan
#### Author:  Tom Walker (thomas.walker@usys.ethz.ch)
#### Date:    26 March 2021
#### ---------------------------------------------------------------------------


#### PROLOGUE ------------------------------------------------------------------

## Options ----
# remove objects from global environment
rm(list = ls())

# configure default R session options (no factors, bias against scientific #s)
options(stringsAsFactors = F,
        scipen = 6)

## Libraries ----
source("packages.r")

## Code ----
sapply(list.files("./r_code",full.names = T), source)


#### PLANS ---------------------------------------------------------------------

## Load data ----
load_plan <- drake_plan(
  raw_relevees = load_relevees(),
  raw_soil = load_soil(),
  flux_data = load_fluxes(),
  full_try = load_try(),
  gh_plants = load_gh_plants(),
  gh_soil = load_gh_soil()
)

## Format field data ----
field_plan <- drake_plan(
  cover_data = format_relevees(
    raw_relevees = raw_relevees
  ),
  trait_data = process_try(
    cover_data = cover_data, 
    full_try = full_try
  ),
  field_data = combine_field_data(
    cover_data = cover_data, 
    trait_data = trait_data, 
    raw_soil = raw_soil
  ),
  field_data_subset = subset_field_plants(
    field_data = field_data
  )
)


#### MAKE ----------------------------------------------------------------------

## Collate plans ----
weAreGo <- bind_rows(
  load_plan,
  field_plan
)

## Make ----
make(weAreGo)
back to top