Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,20 @@
^.*\.Rproj$
^\.Rproj\.user$
vignettes/cache
vignettes/figure
Notes_for_zoon_developers.md
zoonDemo.R
zoonQuickStart.R
.travis.yml
code_of_conduct.md
vignettes/figure
tests/testthat/*.pdf
tests/testthat/testChangeWorkflow.R
tests/testthat/testGetMaxEnt.R
tests/testthat/testplot.zoonWorkflow.R
tests/testthat/testprint.zoonSummary.R
tests/testthat/testprint.zoonWorkflow.R
tests/testthat/testRerunWorkflow.R
tests/testthat/testRunModules.R
tests/testthat/testsummary.zoonWorkflow.R
tests/testthat/testWholeWorkflows.R
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ vignettes/*.md
vignettes/*.R
vignettes/figure
vignettes/cache

# outputs from testing
tests/testthat/*.pdf
12 changes: 7 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
Package: zoon
Type: Package
Title: Reproducible, Accessible & Shareable Species Distribution Modelling
Version: 0.3.3
Version: 0.4.21
Author: Tim Lucas, Nick Golding, Tom August, Greg McInerny, Emiel van Loon
Maintainer: Nick Golding <[email protected]>
Maintainer: Tom August <[email protected]>
Description: Reproducible and remixable species distribution modelling. The
package reads user submitted modules from an online repository, runs full
SDM workflows and returns output that is fully reproducible.
License: BSD_3_clause + file LICENSE
Imports:
RCurl,
dismo,
rfigshare
rfigshare,
methods
Depends:
raster (>= 2.4-20),
R (>= 3.2.0)
Suggests:
knitr,
testthat
testthat,
gam
VignetteBuilder: knitr
LazyData: TRUE
URL: https://github.com/zoonproject/zoon
RoxygenNote: 5.0.0
RoxygenNote: 5.0.1
11 changes: 11 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,16 @@ export(ZoonPredict)
export(workflow)
import(RCurl)
import(dismo)
import(methods)
import(raster)
importFrom(graphics,par)
importFrom(graphics,plot.new)
importFrom(graphics,rect)
importFrom(graphics,segments)
importFrom(graphics,strwidth)
importFrom(rfigshare,fs_new_article)
importFrom(utils,browseURL)
importFrom(utils,capture.output)
importFrom(utils,download.file)
importFrom(utils,install.packages)
importFrom(utils,sessionInfo)
2 changes: 2 additions & 0 deletions R/BuildModule.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#'
#' @return Name of the module. Outputs a file
#' @name BuildModule
#' @import methods
#' @importFrom utils capture.output
#' @export

BuildModule <- function(object, type, dir='.', title = '', description = '',
Expand Down
1 change: 1 addition & 0 deletions R/ChangeWorkflow.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#'
#'@export
#'@name ChangeWorkflow
#'@importFrom utils sessionInfo
#'@examples \dontrun{
#' w <- workflow(UKAnophelesPlumbeus,
#' UKAir,
Expand Down
6 changes: 2 additions & 4 deletions R/GetPackage.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
#' @param package The name of the package with or without
#' quotes
#' @return NULL
#' @examples
#' \dontrun{
#' GetPackage('gam')
#' }
#' @importFrom utils install.packages
#' @examples GetPackage('gam')
#' @export

GetPackage <- function (package) {
Expand Down
2 changes: 2 additions & 0 deletions R/HelpFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ModuleHelp <- function(module){


# Download a file with libcurl and no messages to the console
#'@importFrom utils download.file

DownloadQuietly <- function(url, file) {
download.file(url,
Expand All @@ -52,6 +53,7 @@ DownloadQuietly <- function(url, file) {
# Display a module helpfile in accordance with the 'help_type' option
# help is either displayed as an HTML or text, pdf is not supported and
# an error is returned
#'@importFrom utils browseURL

DisplayModuleHelp <- function (url) {

Expand Down
16 changes: 9 additions & 7 deletions R/RerunWorkflow.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
#'
#' Takes a workflow object and reruns it.
#'
#'@param workflow A zoonWorkflow object from a previous zoon analysis
#'@param from Which modules should be run. If NULL (default), run from the
#' @param workflow A zoonWorkflow object from a previous zoon analysis
#' @param from Which modules should be run. If NULL (default), run from the
#' first NULL output (i.e. where the workflow broke). Otherwise takes an
#' integer and runs from that module.
#'
#'@return A list with the results of each module and a copy of the
#' @return A list with the results of each module and a copy of the
#' call used to execute the workflow.
#'
#'@export
#'@name RerunWorkflow
#'@examples \dontrun{
#' w <- workflow(UKAnophelesPlumbeus, UKAir,
#' @export
#' @name RerunWorkflow
#' @importFrom utils sessionInfo
#' @examples \dontrun{
#' w <- workflow(UKAnophelesPlumbeus,
#' UKAir,
#' OneHundredBackground,
#' LogisticRegression,
#' SameTimePlaceMap)
Expand Down
7 changes: 6 additions & 1 deletion R/SearchFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
#'@return A list with all module names.
#'@name GetModuleList
#'@param renew Download from github even if we already have a module list.
#' @details This function will only work on a platform that supports the
#' method 'libcurl' in the function url. This can be tested using the function
#' \code{capabilities} (see example).
#'
#'@export
#'@examples \dontrun{GetModuleList()}
#'@examples
#'# GetModuleList requires libcurl to be supported
#'if(capabilities('libcurl')) GetModuleList()

GetModuleList <- function(renew = FALSE){

Expand Down
1 change: 1 addition & 0 deletions R/ZoonFigshare.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#' @param tags Character vector of searchable tags.
#'
#' @importFrom rfigshare fs_new_article
#' @importFrom utils browseURL
#' @export

ZoonFigshare <- function(zoonWorkflow, title = 'My Zoon Workflow',
Expand Down
16 changes: 11 additions & 5 deletions R/plot.zoonWorkflow.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#' @importFrom graphics strwidth

GetCex <- function(string, width = 9) {
# given a string (character vector of length one),
# and a target width on screen, in user coordinates
Expand All @@ -7,6 +9,8 @@ GetCex <- function(string, width = 9) {
return (cex)
}

#' @importFrom graphics strwidth segments

ModuleLabels <- function(colr, IsChain, IsList){
###___ function for writing the module labels

Expand Down Expand Up @@ -43,6 +47,7 @@ ModuleLabels <- function(colr, IsChain, IsList){
} #END ModuleLabels


#' @importFrom graphics rect segments strwidth

Boxed2 <- function (NoOfModules, InModuleList, IsList, IsChain, ModuleNames) {
###___ function for writing the boxes
Expand Down Expand Up @@ -226,18 +231,19 @@ CallLister <- function( callList ){
#' @param \dots currently ignored
#'
#' @method plot zoonWorkflow
#' @importFrom graphics plot.new par rect
#' @export
plot.zoonWorkflow <- function(x, ...) {

# set up new device
plot.new()
par(mar = c(0, 0, 0, 0))

plot(-99, -99,
xlim = c(0, 110),
ylim = c(-100, 125),
xlab = "", ylab = "",
axes = FALSE)
graphics::plot(-99, -99,
xlim = c(0, 110),
ylim = c(-100, 125),
xlab = "", ylab = "",
axes = FALSE)

rect( -200, -200, 200, 200,
col = "cornsilk1",
Expand Down
21 changes: 11 additions & 10 deletions R/zoon.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,22 @@ NULL
#' give the modules in the form of a function
#' e.g. occurrence = AModule(para1 = 2, para2 = 'detail')
#'
#'@param occurrence Occurrence module to be used.
#'@param covariate Covariate module to be used.
#'@param process Process module to be used.
#'@param model SDM model module to be used.
#'@param output Output module to be used.
#'@param forceReproducible Logical whether to force zoon to collect modules
#' @param occurrence Occurrence module to be used.
#' @param covariate Covariate module to be used.
#' @param process Process module to be used.
#' @param model SDM model module to be used.
#' @param output Output module to be used.
#' @param forceReproducible Logical whether to force zoon to collect modules
#' from the online repo. This ensure the analysis is reproducible.
#'
#'@return A list with the results of each module and a copy of the
#' @return A list with the results of each module and a copy of the
#' code used to execute the workflow (what's there now should be source-able
#' though I'm sure there is a much neater approach than the one I took - the
#' ultimate aim would be a much nicer way of enhancing reproducibility).
#'@export
#'@name workflow
#'@examples
#' @export
#' @name workflow
#' @importFrom utils sessionInfo
#' @examples
#'# run a workflow, using the logistic regression model
#'\dontrun{
#'
Expand Down
3 changes: 2 additions & 1 deletion R/zoonHelpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ ErrorModule <- function(cond, mod, e){
message()
# Where did workflow break and where is the progress stored?
x <- paste("Stopping workflow due to error in", module, "module.\n",
"Workflow progress stored in object 'tmpZoonWorkflow'.")
"Workflow progress will be returned.")
# Throw error. The call for this error is meaningless so don't print it.
stop(x, call. = FALSE)
}
Expand Down Expand Up @@ -485,6 +485,7 @@ Writeable <- function (dir) {
#'
#' @export
#' @name GetMaxEnt
#' @importFrom utils browseURL
GetMaxEnt <- function () {
# Send the user to download the MaxEnt executable,
# then find and upload it
Expand Down
123 changes: 0 additions & 123 deletions inst/doc/Building_a_module.R

This file was deleted.

Loading