Skip to content

Commit

Permalink
v1.0 and paper
Browse files Browse the repository at this point in the history
  • Loading branch information
kauedesousa committed May 1, 2023
1 parent d70b354 commit 1c571c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: climatrends
Type: Package
Title: Climate Variability Indices for Ecological Modelling
Version: 0.5
Version: 1.0
Authors@R: c(person("Kauê", "de Sousa",
email = "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-7571-7845")),
Expand Down
8 changes: 4 additions & 4 deletions inst/paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Abiotic factors play an important role in most ecological and crop systems that

# Statement of need

Reproducibility, the ability to repeat the analysis, and replicability, the ability to repeat an experiment [@Stevens2017], are key to perform collaborative scientific research [@Powers2019; @Munafo2017]. It allows scientists to re-perform analysis after a long hiatus and the peers to validate analysis and get new insights using original or new data. This is still a gap in most of the studies in agriculture and ecology. `climatrends` addresses this specific issue. The package originates from a set of scripts to compute climate indices in our previous studies [@deSousa2018; @vanEtten2019]. Building up on the interest in expanding the analysis to other regions and to enable reproducible and replicable studies among different research groups within the CGIAR (https://www.cgiar.org) and partner institutions we developed `climatrends`. Most of the package functions take into account the heterogeneity of testing sites (locations), dates and seasons, a common characteristic of decentralized agricultural trials [@vanEtten2019]. Further development was made to enable time series analysis with fixed periods of time and locations [@deSousa2018]. The package `climatrends` computes temperature, precipitation, crop growing and crop stress indices that were validated by previous studies on climatology and crop science [@Kehel2016; @Aguilar2005; @Challinor2016]. The indices are described in the package's documentation. `climatrends` was released on CRAN in February 2020 and was the first package to provide methods for agroclimatic indices in R, being able to deal with site heterogeneity and time series analysis. `climatrends` is also unique in its integration with API Client data like NASA POWER [@Sparks2018], CHIRPS [@Funk2015; @chirps] and AgERA5 [@Hersbach2020; @Brown2023]. Other packages like `pollen` [@pollen] and `cropgrowdays` [@cropgrowdays] are limited to growing degree days, whereas the package `agroclim` [@agroclim] provides temperature and precipitation indices but is limited to zoning areas. Currently, `climatrends` is part of the CRAN Task View in Agriculture (https://cran.r-project.org/web/views/Agriculture.html) and is complementary to `agroclim` and `cropgrowdays`.
Reproducibility, the ability to repeat the analysis, and replicability, the ability to repeat an experiment [@Stevens2017], are key to performing collaborative scientific research [@Powers2019; @Munafo2017]. It allows scientists to re-perform analysis after a long hiatus and peers to validate analysis and get new insights using original or new data. This is still a gap in most of the studies in agriculture and ecology. `climatrends` addresses this specific issue. The package originates from a set of scripts to compute climate indices in our previous studies [@deSousa2018; @vanEtten2019]. Building up on the interest in expanding the analysis to other regions and to enable reproducible and replicable studies among different research groups within the CGIAR (https://www.cgiar.org) and partner institutions we developed `climatrends`. Most of the package functions take into account the heterogeneity of testing sites (locations), dates and seasons, a common characteristic of decentralized agricultural trials [@vanEtten2019]. Further development was made to enable time series analysis with fixed periods of time and locations [@deSousa2018]. The package `climatrends` computes temperature, precipitation, crop growing and crop stress indices that were validated by previous studies on climatology and crop science [@Kehel2016; @Aguilar2005; @Challinor2016]. The indices are described in the package's documentation. `climatrends` was released on CRAN in February 2020 and was the first package to provide methods for agroclimatic indices in R, being able to deal with site heterogeneity and time series analysis. `climatrends` is also unique in its integration with API Client data like NASA POWER [@Sparks2018], CHIRPS [@Funk2015; @chirps] and AgERA5 [@Hersbach2020; @Brown2023]. Other packages like `pollen` [@pollen] and `cropgrowdays` [@cropgrowdays] are limited to growing degree days, whereas the package `agroclim` [@agroclim] provides temperature and precipitation indices but is limited to zoning areas. Currently, `climatrends` is part of the CRAN Task View in Agriculture (https://cran.r-project.org/web/views/Agriculture.html) and is complementary to `agroclim` and `cropgrowdays`.

The package contains eight main functions (Table 1), with a default method for numeric 'vector' and additional methods implemented via the package `methods` [@RCoreTeam] for classes 'matrix' (or array), 'data.frame', and 'sf' (of geometry POINT or POLYGON) [@sf]. The last two methods are designed to fetch data using API Client, currently from the packages `nasapower` [@Sparks2018] and `chirps` [@chirps].

Expand All @@ -60,7 +60,7 @@ Table 1: Main functions available in climatrends.

During five growing seasons (from 2015 to 2017) in Nicaragua, van Etten *et al.* [-@vanEtten2019] conducted a crowdsourced on-farm trial experiment following the tricot approach [@vanEtten2019tricot] testing 11 common bean varieties (*Phaseolus vulgaris* L.) as incomplete blocks of three randomly allocated to 842 blocks. A Plackett–Luce model was used to analyse the data. The model estimates the *worth*, the probability of each variety to outperform all the others in the set [@Turner2020; @Luce1959; @Plackett1975]. Here we reproduce part of this analysis on the calculation and application of the climate indices. The approach here is slightly different because it considers the growing-degree days from planting date to maturity and add new indices to illustrate the package implementation. The data is available as `data("commonbean", package = "climatrends")`.

We estimate the crop phenological stages based on the growing degree-days using the function `GDD()`. For common bean, we define 900 degree-days, from planting date to maturity [@deMedeiros2016]. The input data is an array with the MODIS temperature data [@Wan2015], the vector with planting dates (`cbean$planting_date`), the required amount of degree-days passed to the argument `degree.days` and the character string 'ndays' specifying that the function must return the values as number of days. `GDD()` computes the degree-days for the time series and return the length of the vector where the accumulated gdd reached the pre-defined threshold of 900 degree-days.
We estimate the crop phenological stages based on the growing degree-days using the function `GDD()`. For common bean, we define 900 degree-days, from planting date to maturity [@deMedeiros2016]. The input data is an array with the MODIS temperature data [@Wan2015], the vector with planting dates (`cbean$planting_date`), the required amount of degree-days passed to the argument `degree.days` and the character string 'ndays' specifying that the function must return the values as number of days. `GDD()` computes the degree-days for the time series and return the length of the vector where the accumulated growing degree-days reached the pre-defined threshold of 900 degree-days.

The degree-days spanned from 54 to 100 days as shown in Fig. 1a. For simplicity we take the average per season and use this vector to compute the temperature indices.

Expand Down Expand Up @@ -109,12 +109,12 @@ Seasonal distribution of maxNT captured for each incomplete block in this experi

{\centering \includegraphics[width=0.8\linewidth]{cbean}}

\caption{Fig. 1. Application of climatrends functions to support the analysis of decentralized on-farm trial data. (A) Days required to reach 900 growing-degree days from planting date calculated using the function GDD(). (B) Maximum night temperature (°C) distributed across seasons computed using the function temperature(). (C) Plackett-Luce Tree showing the probability that a given variety outperforms the other varieties (axys X) in three different nodes splitted with the summer days (day temperature > 30 °C) and maximum night temperature (°C). Note: the first season (primera, Pr) spans from May to August, the second (postrera, Po) from September to October, and the third (apante, Ap) from November to January.}\label{fig:fig_cbean}
\caption{Fig. 1. Application of `climatrends` functions to support the analysis of decentralized on-farm trial data. (A) Days required to reach 900 growing-degree days from planting date calculated using the function `GDD()`. (B) Maximum night temperature (°C) distributed across seasons computed using the function `temperature()`. (C) Plackett-Luce Tree showing the probability that a given variety outperforms the other varieties (axys X) in three different nodes splitted with the summer days (day temperature > 30 °C) and maximum night temperature (°C). Note: the first season (primera, Pr) spans from May to August, the second (postrera, Po) from September to October, and the third (apante, Ap) from November to January.}\label{fig:fig_cbean}
\end{figure}

# Further development

The package can support the integration with other datasets as they become available in `R` via API client packages. In the future, new indices related to the physiology of crops could be implemented. To explore the latest functionalities of `climatrends`, please check the package's updates at CRAN (https://cran.r-project.org/package=climatrends).
The package can support the integration with other datasets as they become available in `R` via API client packages. In the future, new indices related to the physiology of crops could be implemented. Integration with daily high resolution climate data and seasonal forecast for East Africa from Tomorrow.io's Comprehensive Bespoke Atmospheric Model (CBAM) is under development. To explore the latest functionalities of `climatrends`, please check the package's updates at CRAN (https://cran.r-project.org/package=climatrends).

# Acknowledgements

Expand Down

0 comments on commit 1c571c9

Please sign in to comment.