Skip to content

Commit

Permalink
version0.2-3
Browse files Browse the repository at this point in the history
  • Loading branch information
kauedesousa committed Aug 5, 2019
1 parent 0bba764 commit 03dedc9
Show file tree
Hide file tree
Showing 27 changed files with 238 additions and 142 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Authors@R: c(person("Kaue", "de Sousa",
Maintainer: Kaue de Sousa <[email protected]>
URL: https://agrobioinfoservices.github.io/ClimMobTools/
BugReports: https://github.com/agrobioinfoservices/ClimMobTools/issues
Description: Toolkit for the 'ClimMob' platform in R. 'ClimMob' is an open source software for crowdsourcing citizen science in agriculture <https://climmob.net/climmob3/>. Developed by van Etten et al. (2019) <doi:10.1017/S0014479716000739>, it turns the research paradigm on its head; instead of a few researchers designing complicated trials to compare several technologies in search of the best solutions, it enables many farmers to carry out reasonably simple experiments that taken together can offer even more information.
Description: Toolkit for the 'ClimMob' platform in R. 'ClimMob' is an open source software for crowdsourcing citizen science in agriculture <https://climmob.net/climmob3/>. Developed by van Etten et al. (2019) <doi:10.1017/S0014479716000739>, it turns the research paradigm on its head; instead of a few researchers designing complicated trials to compare several technologies in search of the best solutions, it enables many farmers to carry out reasonably simple experiments that taken together can offer even more information. ClimMobTools enables project managers to deep explore and analyse their ClimMob data in R.
License: GPL-3
Encoding: UTF-8
LazyData: true
Expand Down
9 changes: 8 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@

## New Features

* Function `build_rankings` is added to convert the tricot data into an object of class rankings from **PlackettLuce**
* Function `build_rankings` is added to convert the tricot data into an object of class rankings from **PlackettLuce**.
* Function `seed_need` is added to calculate the required amount of seeds/seedlings needed for the tricot project

## CRAN issues

* please makew the title title case *>>>* the title is correct **ClimMobTools**
* gosset is not in a standard repository nor do you have declared where to get this from. See the CRAN policies how to do that. No reason to put this in "dontrun{}". But protect the example to only run if gosset is available ion the user's machine. *>>>* **gosset** is a package under development. All dependencies to **gosset** were removed and function `build_rankings` was added into **ClimMobTools** as a replacement to `gosset::to_rankings`.
* Perhaps also add an example that is easily executable by everyone even without gosset? *>>>* a practical example was added, but other functions `rainfall`, `ETo` and `GDD` (which use the same approach as `temperature`) has practical examples in "dontrun{}" to avoid elapsed time during CRAN checks.


# ClimMobTools 0.2-2

## New Features
Expand Down
26 changes: 15 additions & 11 deletions R/ETo.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,24 @@
#' @return The evapotranspiration in mm/day
#' @examples
#' \dontrun{
#'
#' # use the breadwheat data from package gosset
#' library("gosset")
#'
#' library("ClimMobTools")
#' library("nasapower")
#' library("raster")
#'
#' data("breadwheat", package = "gosset")
#' # random geographic locations around bbox(11, 12, 55, 58)
#' lonlat <- data.frame(lon = runif(10, 11, 12),
#' lat = runif(10, 55, 58))
#'
#' # random planting dates around 2018-05-15 and 2018-05-20
#' pdates <- as.integer(runif(10, 17666, 17670))
#' pdates <- as.Date(pdates, origin = "1970-01-01")
#'
#' # the evapotranspiration in the first 100 days after planting
#' ETo(breadwheat[c("lon","lat")],
#' day.one = breadwheat[["planting_date"]],
#' span = 100,
#' lat = breadwheat[["lat"]])
#'}
#' # the evapotranspiration in the first 50 days after planting
#' ETo(lonlat,
#' day.one = pdates,
#' span = 50,
#' lat = lonlat[["lat"]])
#' }
#'
#' @export
ETo <- function(object, day.one = NULL, span = NULL,
Expand Down
16 changes: 10 additions & 6 deletions R/GDD.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@
#' @return The number of days required to reach the growing degree days.
#' @examples
#' \dontrun{
#' # use the breadwheat data from package gosset
#' library("gosset")
#' library("ClimMobTools")
#' library("nasapower")
#' library("raster")
#'
#' data("breadwheat", package = "gosset")
#' # random geographic locations around bbox(11, 12, 55, 58)
#' lonlat <- data.frame(lon = runif(10, 11, 12),
#' lat = runif(10, 55, 58))
#'
#' # random planting dates around 2018-05-15 and 2018-05-20
#' pdates <- as.integer(runif(10, 17666, 17670))
#' pdates <- as.Date(pdates, origin = "1970-01-01")
#'
#' # Calculate the days required for the plants in these plots to reach the
#' # maturity. The crop requires ~1800 degree days for it.
#'
#' GDD(breadwheat[c("lon","lat")],
#' day.one = breadwheat[["planting_date"]],
#' GDD(lonlat,
#' day.one = pdates,
#' degree.days = 1800,
#' base = 5)
#'}
Expand Down
2 changes: 2 additions & 0 deletions R/getDataCM.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#' \dontrun{
#'
#' # This function will not work without an API key
#' # the user API key can be obtained once a free ClimMob account
#' # is created via https://climmob.net/climmob3/
#'
#' my_key <- "add_your_key"
#' my_project <- "my_climmob_project"
Expand Down
4 changes: 3 additions & 1 deletion R/getProjectsCM.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
#' \item{creation_date}{the project's creation date}
#' @examples
#' \dontrun{
#' # This function will not work without an API key
#' # This function will not work without an API key
#' # the user API key can be obtained once a free ClimMob account
#' # is created via https://climmob.net/climmob3/
#'
#' my_key <- "add_your_key"
#'
Expand Down
28 changes: 17 additions & 11 deletions R/rainfall.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,31 @@
#' \item{Rtotal}{total rainfall (mm) in wet days (R >= 1)}
#' @examples
#' \dontrun{
#' # use the breadwheat data from package gosset
#' library("gosset")
#'
#' library("ClimMobTools")
#' library("nasapower")
#' library("raster")
#'
#' data("breadwheat", package = "gosset")
#' # random geographic locations around bbox(11, 12, 55, 58)
#' lonlat <- data.frame(lon = runif(10, 11, 12),
#' lat = runif(10, 55, 58))
#'
#' # random planting dates around 2018-05-15 and 2018-05-20
#' pdates <- as.integer(runif(10, 17666, 17670))
#' pdates <- as.Date(pdates, origin = "1970-01-01")
#'
#' # calculate rainfall for the first 50 days after planting
#' rainfall(breadwheat[c("lon","lat")],
#' day.one = breadwheat[["planting_date"]],
#' rainfall(lonlat,
#' day.one = pdates,
#' span = 50)
#'
#'
#'
#' # include the first 15 days before planting (residual precipitation)
#' rainfall(breadwheat[c("lon","lat")],
#' day.one = breadwheat[["planting_date"]],
#' rainfall(lonlat,
#' day.one = pdates,
#' span = 50,
#' days.before = 15)
#'}
#' days.before = 15)
#'
#' }
#'
#' @export
rainfall <- function(object, day.one = NULL, span = NULL,
Expand Down
4 changes: 2 additions & 2 deletions R/randomise.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#' @return A dataframe with the randomised design
#' @examples
#' ni <- 3
#' no <- 50
#' no <- 10
#' nv <- 4
#' inames <- paste("Var", 1:nv, sep="")
#' inames <- c("mango","banana","grape","apple")
#'
#' randomise(ncomp = ni,
#' nobservers = no,
Expand Down
23 changes: 13 additions & 10 deletions R/temperature.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@
#' \item{SU}{summer days, number of days with maximum temperature > 30 (degree Celsius)}
#' \item{TR}{tropical nights, number of nights with maximum temperature > 25 (degree Celsius) }
#' @examples
#' \dontrun{
#'
#' # use the breadwheat data from package gosset
#' library("gosset")
#'
#' library("ClimMobTools")
#' library("nasapower")
#' library("raster")
#'
#' data("breadwheat", package = "gosset")
#' # random geographic locations around bbox(11, 12, 55, 58)
#' lonlat <- data.frame(lon = runif(10, 11, 12),
#' lat = runif(10, 55, 58))
#'
#' temperature(breadwheat[c("lon","lat")],
#' day.one = breadwheat[["planting_date"]],
#' span = 40)
#'}
#' # random planting dates around 2018-05-15 and 2018-05-20
#' pdates <- as.integer(runif(10, 17666, 17670))
#' pdates <- as.Date(pdates, origin = "1970-01-01")
#'
#' # get temperature indices for the first 40 days
#' temperature(lonlat,
#' day.one = pdates,
#' span = 40)
#'
#' @export
temperature <- function(object, day.one = NULL, span = NULL,
index = NULL, ...)
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Package website: https://agrobioinfoservices.github.io/ClimMobTools/

## Overview

The **ClimMobTools** package provides the toolkit for the [ClimMob](https://climmob.net/climmob3/) platform in `R`. ClimMob is an open source software for crowdsourcing citizen science in agriculture. Developed by van Etten et al. [(2019)](https://doi.org/10.1017/S0014479716000739), it turns the research paradigm on its head; instead of a few researchers designing complicated trials to compare several technologies in search of the best solutions, it enables many farmers to carry out reasonably simple experiments that taken together can offer even more information.
The **ClimMobTools** package provides the toolkit for the [ClimMob](https://climmob.net/climmob3/) platform in `R`. ClimMob is an open source software for crowdsourcing citizen science in agriculture. Developed by van Etten et al. [(2019)](https://doi.org/10.1017/S0014479716000739), it turns the research paradigm on its head; instead of a few researchers designing complicated trials to compare several technologies in search of the best solutions, it enables many farmers to carry out reasonably simple experiments that taken together can offer even more information. **ClimMobTools** enables project managers to deep explore and analyse their ClimMob data in R.

## Installation

Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ Package website: <https://agrobioinfoservices.github.io/ClimMobTools/>
Overview
--------

The **ClimMobTools** package provides the toolkit for the [ClimMob](https://climmob.net/climmob3/) platform in `R`. ClimMob is an open source software for crowdsourcing citizen science in agriculture. Developed by [Bioversity International](https://www.bioversityinternational.org/), it turns the research paradigm on its head; instead of a few researchers designing complicated trials to compare several technologies in search of the best solutions, it enables many farmers to carry out reasonably simple experiments that taken together can offer even more information. The concept behind the methodology applied by ClimMob is demonstrated by van Etten et al. [(2019a)](https://doi.org/10.1017/S0014479716000739), with its applications for crop management demonstrated by van Etten et al [(2019b)](https://doi.org/10.1073/pnas.1813720116).
The **ClimMobTools** package provides the toolkit for the [ClimMob](https://climmob.net/climmob3/) platform in `R`. ClimMob is an open source software for crowdsourcing citizen science in agriculture. Developed by van Etten et al. [(2019)](https://doi.org/10.1017/S0014479716000739), it turns the research paradigm on its head; instead of a few researchers designing complicated trials to compare several technologies in search of the best solutions, it enables many farmers to carry out reasonably simple experiments that taken together can offer even more information. **ClimMobTools** enables project managers to deep explore and analyse their ClimMob data in R.

Installation
------------

The development version can be installed via

library("devtools")
devtools::install_github("agrobioinfoservices/ClimMobTools", upgrade = "never")
``` r
library("devtools")

devtools::install_github("agrobioinfoservices/ClimMobTools")
```

Going further
-------------

The full functionality of **ClimMobTools** is illustrated in the package vignette. The vignette can be found on the [package website](https://agrobioinfoservices.github.io/ClimMobTools/) or from within `R` once the package has been installed, e.g. via

vignette("Overview", package = "ClimMobTools")
``` r
vignette("Overview", package = "ClimMobTools")
```

Contribution
------------
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 03dedc9

Please sign in to comment.