Giter VIP home page Giter VIP logo

trex's Introduction

TREX

Lifecycle: maturing R-CMD-check

TREX allows to assimilate, process and analyse sap flow data obtained with the thermal dissipation method (TDM). The package includes functions for gap filling time-series data, detecting outliers, calculating data-processing uncertainties and generating uniform data output and visualisation. The package is designed to deal with large quantities of data and apply commonly used data-processing methods. The functions have been validated on data collected from different tree species across the northern hemisphere (Peters et al. 2018 <doi: 10.1111/nph.15241>), and an accompanying manuscript has been published in Methods in Ecology and Evolution as (Peters et al. 2020 <doi: 10.1111/2041-210X.13524>)


1. Installation

The latest version of TREX can be installed and used via

remotes::install_github("the-Hull/TREX")

library(TREX)

If you want to use CRAN, we have a stable release version used for the MEE manuscript available named TREXr:

install.packages("TREXr")

2. Basic use and workflow

Load data

# load raw data
raw   <- is.trex(example.data(type="doy"),
                 tz="GMT",
                 time.format="%H:%M",
                 solar.time=TRUE,
                 long.deg=7.7459,
                 ref.add=FALSE)
                 
# adjust time steps
input <- dt.steps(input=raw, 
                start="2013-05-01 00:00",
                end="2013-11-01 00:00",
                time.int=15,
                max.gap=60,
                decimals=10,
                df=FALSE)
                
# remove obvious outliers
input[which(input<0.2)]<- NA

Calculate maximum ΔT-Values

Three methods can be applied to calculate ΔT (or ΔV for voltage differences between TDM probes):

  • pd: pre-dawn
  • mw: moving-window
  • dr: double-regression
input <- tdm_dt.max(input,
                    methods = c("pd", "mw", "dr"),
                    det.pd = TRUE,
                    interpolate = FALSE,
                    max.days = 10,
                    df = FALSE)
                    
plot(input$input, ylab = expression(Delta*italic("V")))

lines(input$max.pd, col = "green")
lines(input$max.mw, col = "blue")
lines(input$max.dr, col = "orange")

Calculate Sap Flux Density

output.data<- tdm_cal.sfd(input,make.plot=TRUE,df=FALSE,wood="Coniferous")

plot(output.data$sfd.pd$sfd[1:1000, ], ylim=c(0,10))
# see estimated uncertainty
lines(output.data$sfd.pd$q025[1:1000, ], lty=1,col="grey")
lines(output.data$sfd.pd$q975[1:1000, ], lty=1,col="grey")
lines(output.data$sfd.pd$sfd[1:1000, ])

sfd_data <- output.data$sfd.dr$sfd

Generate Outputs

Here we generate outputs based on environmental filters and calculate crown conductance (Gc) values.

output<- out.data(input=sfd_data,
                  vpd.input=vpd, 
                  sr.input=sr,
                  prec.input=preci,
                  low.sr = 150,
                  peak.sr=300, 
                  vpd.cutoff= 0.5, 
                  prec.lim=1,
                  method="env.filt", 
                  max.quant=0.99, 
                  make.plot=TRUE)

3. More on TREX

Workshops using TREX

  • ESA 2020: TREX was introduced and demonstrated in detail in a workshop during the Ecological Society of America's 2020 AGM. The workshop description can be found here, and all materials on the dedicated page.

4. Citing this work

Please cite TREX when you apply it in your own work as:

Peters, RL, Pappas, C, Hurley, AG, et al. Assimilate, process and analyse thermal dissipation sap flow data using the TREX r package. Methods Ecol Evol. 2021; 12: 342– 350. https://doi.org/10.1111/2041-210X.13524

A reference is available in R using:

citation("TREX")

#or

citation("TREXr")

trex's People

Contributors

the-hull avatar

Stargazers

Andreas Motl avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

trex's Issues

Error when running tdm_cal.sfd()

Hey.

First of all, thank you and the team for all the great work you did on the sap flow package.

While going through the package functionalists with the supplied example.data() from README.md I ran into an error while running the tdm_cal.sfd():

Error in xtfrm.data.frame(x) : cannot xtfrm data frames

It seams to be an ordering issue.

I'm using R version 4.3.2 on RStudio version 2023.9.1.494

Release TREX 1.0.0

Prepare for release:

  • Check that description is informative
  • Check licensing of included files
  • usethis::use_cran_comments()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • Update cran-comments.md
  • Add citation
  • Draft DEEP blog post

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_news_md()
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Update install instructions in README
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.