Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

  • 75c5ddb
  • /
  • drake_plan.R
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
content badge Iframe embedding
swh:1:cnt:cefd43eb5ca873bf6a0f4ab753bd1dbe36222b78
directory badge Iframe embedding
swh:1:dir:75c5ddbef297baf7569925ddcabed812ad0e62c3

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
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
  )
)

# ## Write all data to file ----
# export_plan <- drake_plan(
#   localExport = target(
#     command = {
#       save(
#         # Original species information
#         edAllSpp,
#         # Species information
#         pfSpecies, edSpecies,
#         # Phylogenies
#         pfPhylogeny, edPhylogeny,
#         # Trait data
#         pfTraits, edTraits,
#         pfTraitsPCA, edTraitsPCA,
#         # Metabolite data
#         pfMtbs, edMtbs,
#         pfMtbsDiv, edMtbsDiv,
#         pfMtbsPCoA, edMtbsPCoA,
#         # Biogeography data
#         pfBioGeo, edBioGeo,
#         pfClimPCA, edClimPCA,
#         # Output
#         file = file_out("./data/exported/all_data.RData")
#       )
#       save(
#         # Full biogeographic data for plotting
#         pfBioGeoAll, edBioGeoAll,
#         # Output
#         file = file_out("./data/exported/geo_data.RData")
#       )
#       
#     }
#   )
# )


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

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

## Make ----
make(weAreGo)

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API