Learn R Programming

⚠️There's a newer version (0.1.2) of this package.Take me there.

fxTWAPLS: An Improved Version of WA-PLS

Overview

The goal of this package is to provide an improved version of WA-PLS by including the tolerances of taxa and the frequency of the sampled climate variable. This package also provides a way of leave-out cross-validation that removes both the test site and sites that are both geographically close and climatically close for each cycle, to avoid the risk of pseudo-replication.

Installation

You can install the released version of fxTWAPLS from CRAN with:

install.packages("fxTWAPLS")

And the development version from GitHub with:

install.packages("remotes")
remotes::install_github("special-uor/fxTWAPLS", "dev")

Publications

install.packages("remotes")
remotes::install_github("special-uor/fxTWAPLS@v0.0.2")

Notes

The following functions can be executed in parallel:

To do so, include the cpus parameter. For example:

# without fx
cv_Tmin <- fxTWAPLS::cv.w(taxa,
                          modern_pollen$Tmin,
                          nPLS = 5,
                          fxTWAPLS::WAPLS.w,
                          fxTWAPLS::WAPLS.predict.w,
                          cpus = 2)

Optionally, a progress bar can be displayed for long computations. Just “pipe” the function call to fxTWAPLS::pb().

# without fx
`%>%` <- magrittr::`%>%`
cv_Tmin <- fxTWAPLS::cv.w(taxa,
                          modern_pollen$Tmin,
                          nPLS = 5,
                          fxTWAPLS::WAPLS.w,
                          fxTWAPLS::WAPLS.predict.w,
                          cpus = 2) %>%
  fxTWAPLS::pb()

Alternatively, if you are not familiar with the “pipe” operator, you can run the following code:

# without fx
cv_Tmin <- fxTWAPLS::pb(fxTWAPLS::cv.w(taxa,
                                       modern_pollen$Tmin,
                                       nPLS = 5,
                                       fxTWAPLS::WAPLS.w,
                                       fxTWAPLS::WAPLS.predict.w,
                                       cpus = 2))
  

Copy Link

Version

Install

install.packages('fxTWAPLS')

Monthly Downloads

595

Version

0.1.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Roberto Villegas-Diaz

Last Published

January 17th, 2022

Functions in fxTWAPLS (0.1.0)

WAPLS.predict.w

WA-PLS predict function
WAPLS.w

WA-PLS training function
fxTWAPLS-package

fxTWAPLS: An Improved Version of WA-PLS
TWAPLS.w

TWA-PLS training function
TWAPLS.predict.w

TWA-PLS predict function
cv.pr.w

Pseudo-removed leave-out cross-validation
cv.w

Leave-one-out cross-validation
TWAPLS.w2

TWA-PLS training function v2
fx

Get frequency of the climate value
WAPLS.w2

WA-PLS training function v2
fx_pspline

Get frequency of the climate value with p-spline smoothing
rand.t.test.w

Random t-test
sse.sample

Calculate Sample Specific Errors
plot_train

Plot the training results
plot_residuals

Plot the residuals
get_pseudo

Get geographically and climatically close sites
get_distance

Get the distance between points
pb

Show progress bar