Skip to content

Commit

Permalink
Check and build files added for 1.7.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonGoring committed Jan 4, 2019
1 parent 8a3aa68 commit c683998
Show file tree
Hide file tree
Showing 168 changed files with 17,291 additions and 0 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
^CRAN-RELEASE$
^.*\.Rproj$
^\.Rproj\.user$
^.*\.yml
Expand Down
2 changes: 2 additions & 0 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This package was submitted to CRAN on 2019-01-03.
Once it is accepted, delete this file and tag the release (commit 8a3aa68e0b).
28 changes: 28 additions & 0 deletions neotoma.Rcheck/00_pkg_src/neotoma/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Package: neotoma
Type: Package
Title: Access to the Neotoma Paleoecological Database Through R
Version: 1.7.4
Date: 2019-01-03
Encoding: UTF-8
Author: Simon J. Goring [aut, cre], Gavin L. Simpson [aut], Jeremiah P. Marsicek
[ctb], Karthik Ram [aut], Luke Sosalla [ctb]
Authors@R: c(person(given = c("Simon", "J."), family = "Goring",
role = c("aut", "cre"), email = "[email protected]"),
person(given = c("Gavin", "L."), family = "Simpson", role = "aut"),
person(given = c("Jeremiah", "P."), family = "Marsicek", role = "ctb"),
person(given = "Karthik", family = "Ram", role = "aut"),
person(given = "Luke", family = "Sosalla", role = "ctb"))
Maintainer: Simon J. Goring <[email protected]>
Description: Access paleoecological datasets from the Neotoma Paleoecological
Database using the published API (<http://api.neotomadb.org/>). The functions
in this package access various pre-built API functions and attempt to return
the results from Neotoma in a usable format for researchers and the public.
License: MIT + file LICENSE
URL: https://github.com/ropensci/neotoma
BugReports: https://github.com/ropensci/neotoma/issues
Depends: R (>= 2.10)
Imports: plyr, reshape2, jsonlite, httr, xml2, analogue, leaflet, dplyr
Suggests: testthat, knitr
RoxygenNote: 6.1.1
NeedsCompilation: no
Packaged: 2019-01-03 23:57:10 UTC; simon
2 changes: 2 additions & 0 deletions neotoma.Rcheck/00_pkg_src/neotoma/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2016
COPYRIGHT HOLDER: Simon Goring
125 changes: 125 additions & 0 deletions neotoma.Rcheck/00_pkg_src/neotoma/NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Generated by roxygen2: do not edit by hand

S3method(Stratiplot,download)
S3method(Stratiplot,download_list)
S3method(ages,download)
S3method(ages,download_list)
S3method(bind,default)
S3method(browse,dataset)
S3method(browse,dataset_list)
S3method(browse,default)
S3method(browse,download)
S3method(browse,download_list)
S3method(counts,download)
S3method(counts,download_list)
S3method(depths,default)
S3method(depths,download)
S3method(depths,download_list)
S3method(get_chroncontrol,dataset)
S3method(get_chroncontrol,dataset_list)
S3method(get_chroncontrol,default)
S3method(get_chroncontrol,download)
S3method(get_chroncontrol,download_list)
S3method(get_closest,dataset)
S3method(get_closest,default)
S3method(get_closest,download)
S3method(get_closest,site)
S3method(get_dataset,default)
S3method(get_dataset,download)
S3method(get_dataset,download_list)
S3method(get_dataset,geochronologic)
S3method(get_dataset,geochronologic_list)
S3method(get_dataset,integer)
S3method(get_dataset,numeric)
S3method(get_dataset,site)
S3method(get_download,dataset)
S3method(get_download,dataset_list)
S3method(get_download,default)
S3method(get_download,site)
S3method(get_geochron,dataset)
S3method(get_geochron,dataset_list)
S3method(get_geochron,default)
S3method(get_geochron,site)
S3method(get_publication,dataset)
S3method(get_publication,dataset_list)
S3method(get_publication,default)
S3method(get_publication,download)
S3method(get_publication,download_list)
S3method(get_site,dataset)
S3method(get_site,dataset_list)
S3method(get_site,default)
S3method(get_site,download)
S3method(get_site,download_list)
S3method(get_site,geochronologic)
S3method(get_site,geochronologic_list)
S3method(get_site,integer)
S3method(get_site,numeric)
S3method(plot,dataset)
S3method(plot,dataset_list)
S3method(plot,download)
S3method(plot,download_list)
S3method(plot,site)
S3method(plot_leaflet,dataset)
S3method(plot_leaflet,dataset_list)
S3method(plot_leaflet,download)
S3method(plot_leaflet,download_list)
S3method(print,chroncontrol)
S3method(print,dataset)
S3method(print,dataset_list)
S3method(print,download)
S3method(print,download_list)
S3method(print,geochronologic)
S3method(print,geochronologic_list)
S3method(print,site)
S3method(taxa,download)
S3method(taxa,download_list)
export(ages)
export(bind)
export(browse)
export(compile_downloads)
export(compile_taxa)
export(counts)
export(depths)
export(get_chroncontrol)
export(get_closest)
export(get_contact)
export(get_dataset)
export(get_download)
export(get_geochron)
export(get_publication)
export(get_site)
export(get_table)
export(get_taxa)
export(param_check)
export(plot_leaflet)
export(read.tilia)
export(read_bacon)
export(taxa)
export(write_agefile)
importFrom(analogue,Stratiplot)
importFrom(analogue,tran)
importFrom(dplyr,bind_rows)
importFrom(graphics,legend)
importFrom(graphics,par)
importFrom(graphics,plot)
importFrom(graphics,points)
importFrom(httr,GET)
importFrom(httr,content)
importFrom(jsonlite,fromJSON)
importFrom(leaflet,addCircleMarkers)
importFrom(leaflet,addProviderTiles)
importFrom(leaflet,leaflet)
importFrom(leaflet,markerClusterOptions)
importFrom(leaflet,markerOptions)
importFrom(plyr,ldply)
importFrom(stats,aggregate)
importFrom(stats,na.omit)
importFrom(utils,browseURL)
importFrom(utils,write.csv)
importFrom(utils,write.table)
importFrom(xml2,as_list)
importFrom(xml2,read_xml)
importFrom(xml2,xml_attr)
importFrom(xml2,xml_find_all)
importFrom(xml2,xml_find_one)
importFrom(xml2,xml_text)
94 changes: 94 additions & 0 deletions neotoma.Rcheck/00_pkg_src/neotoma/NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
neotoma 1.7.4
====================
o Bug fix: `get_dataset(gpid=123) was returning an error, fix corrects the error to allow unassigned `x` variables.
o Updated the allowable dataset types for searching to reflect the larger set of dataset types within Neotoma.

neotoma 1.7.3
====================
o Added numeric/integer methods to the `get_site` and `get_dataset` functions so that a vector of dataset or siteids can be passed to improve more general workflow methods.

neotoma 1.7.2
====================
o Bugfixes, added the `taxa` function to easily extract taxa from one or multiple download objects.

neotoma 1.7.1
====================
o Bugfix for `compile_download`, single sample downloads were failing to compile properly.

neotoma 1.7.0
====================
o Added `plot_leaflet` to allow interactive exploration of downloaded Neotoma data. Integrates with the Neotoma Explorer.
o Minor bugfix for `get_download` to allow records to be sent to Neotoma and to be filtered.

neotoma 1.6.2
====================
o Bugfix in `get_chroncontrol`, `read.tilia` based on experience in extensive testing. Improved the basic `plot` method based on tests against Tilia files in the Neotoma Holding Tank.
o Built more robust interpolation in `read_bacon` so that age models without interpolated dates can still be imported.
o `browse` now opens multiple datastes in the Neotoma Explorer at once.

neotoma 1.6.1
====================
o Bugfix
o New `Stratiplot` method, using the `analogue` package to plot dataset diagrams from `download` and `download_list` objects.
o Bug fixes for `write_agefile`
o New function `read_bacon` to read in and integrate Bacon chronologies into `download` objects.

neotoma 1.6.0
====================
o Support for vector inputs in the `gpid` selection.
o Added a `get_closest` function to find the closest datasets to a sample site.
o Mostly clean-up of reported bugs by users.
o Revised examples for faster check speed.

neotoma 1.5.1
====================
o Fix for datasets with empty submission dates.
o Some minor (non-functional) code cleaning.
o Added extra tests.

neotoma 1.5.0
====================
o More extensive testing to support multiple dataset types. Water chemistry datasets still unsupported.
o Function `read.tilia` added to read Tilia (http://tiliait.com) style XML files.
o Moved to using `xml2`, `httr` and `jsonlite` to support parsing.

neotoma 1.4.0
====================
o The few records without chronologies were causing errors when `get_download` was applied.
o Added plot method.

neotoma 1.3.3
====================
o Critical bug fix: `get_download` now correctly assigns the default chronology to `sample.meta`. All other chronologies (including the default) are stored in the `chronologies` list for the `download`.
o Bugfix for issue #187, empty `dataset_list`s now return a NULL value, rather than breaking the `print` method.

neotoma 1.3.2
====================
o Bugfix for `get_download`, assignment to the `dataset.id` was incorrectly placed causing the columns to be out of place relative to the data.

neotoma 1.3.1
====================
o Bugfix for `write_agefile`
o Added a `browse` method for datasets, that will open a browser window for a specific dataset or download.
o The deprecated `compile_list` function has now been removed. Use `compile_taxa` instead.

neotoma 1.3.0
====================
o Improved functionality of get_chroncontrol to allow it to deal with empty tables and work directly with download and download_list objects.

neotoma 1.2-0
====================
o Added new datasettypes for records, including water chemistry, charcoal, XRD and others.

neotoma 1.1-0
====================
o Publication of Goring, S., Dawson, A., Simpson, G. L., Ram, K., Graham, R. W., Grimm, E. C., & Williams, J. W.. (2015). neotoma: A Programmatic Interface to the Neotoma Paleoecological Database, 1(1), Art. 2. DOI: http://doi.org/10.5334/oq.ab

neotoma 0.1
====================
o continued development of API implementation and working toward a common
standard for data output.

o Continued development of tests for the package.

o Changed function names to singular.
75 changes: 75 additions & 0 deletions neotoma.Rcheck/00_pkg_src/neotoma/R/Stratiplot.download.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#' @title Palaeoecological stratigraphic diagrams
#' @description Draws paleoecological diagrams from a \code{download} object. Allows control of variable type (using the \code{tran} function from the \code{analogue} package), and taxonomic grouping.
#' @param x A \code{download} object.
#' @param yaxis One of the columns in \code{sample.meta}, including \code{depth}, \code{age}, \code{age.younger}, or \code{age.older}, default \code{age}.
#' @param method An option for axis transformation using \code{tran} from the \code{analogue} package. \code{"none"} by default.
#' @param group An ecological group from the taxon table.
#' @param ... variables to be passed to \code{Stratiplot}.
#' @details A wrapper for the \code{analogue} package's \code{Stratiplot} function. Allowing the user to plot a stratigraphic diagram directly from a \code{download} object.
#' @return A \code{trellis} object.
#' @examples
#' \dontrun{
#' lake_o_dl <- get_download(15925)
#' Stratiplot(lake_o_dl[[1]])
#' }
#' @importFrom analogue Stratiplot tran
#'@export
#'
Stratiplot.download <- function(x, yaxis = "age", method = "none", group = NULL, ...) {
counts <- counts(x)

if (!yaxis %in% c("depth", "age.older", "age.younger", "age")) {
stop("You must provide a suitable variable name for the y axis.")
}

if (!"sample.meta" %in% names(x) | all(is.na(x$sample.meta[,yaxis]))) {
stop("This download has no suitable chronological or depth information.")
}

if (!is.null(group)) {
taxa <- x$taxon.list$taxon.name[x$taxon.list$ecological.group %in% group]
} else {
taxa <- x$taxon.list$taxon.name[!x$taxon.list$ecological.group %in% "LABO" ]

}

y <- x$sample.meta[,yaxis]

counts <- analogue::tran(counts[,taxa], method = method)

analogue::Stratiplot(counts, y, ...)

}

#' @title Palaeoecological stratigraphic diagrams
#' @description Draws paleoecological diagrams from a \code{download_list} object. Allows control of variable type (using the \code{tran} function from the \code{analogue} package), and taxonomic grouping.
#' This function only works for \code{download_list} objects that contain a single object.
#' @param x A \code{download_list} object.
#' @param yaxis One of the columns in \code{sample.meta}, including \code{depth}, \code{age}, \code{age.younger}, or \code{age.older}, default \code{age}.
#' @param method An option for axis transformation using \code{tran} from the \code{analogue} package. \code{"none"} by default.
#' @param group An ecological group from the taxon table.
#' @param ... variables to be passed to \code{Stratiplot}.
#' @details A wrapper for the \code{analogue} package's \code{Stratiplot} function. Allowing the user to plot a stratigraphic diagram directly from a \code{download} object.
#' @return A \code{trellis} object.
#' @examples
#' \dontrun{
#' lake_o_dl <- get_download(15925)
#' # This works:
#' Stratiplot(lake_o_dl)
#'
#' lakes_o_nw <- get_download(get_site(sitename = "Lake B%"))
#' # This Fails:
#' # Stratiplot(lake_o_nw)
#'
#' }
#' @importFrom analogue Stratiplot tran
#' @export
#'
Stratiplot.download_list <- function(x, yaxis = "age", method = "none", group = NULL, ...) {
if (length(x) == 1) {
Stratiplot(x[[1]], yaxis = "age", method = "none", group = NULL, ...)
} else {
stop("You must select a single `download` object to plot.")
}

}
42 changes: 42 additions & 0 deletions neotoma.Rcheck/00_pkg_src/neotoma/R/ages.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
##' Extracts age information from objects and returns them in a useful format.
##'
##' Methods are available for "download" and "download_list" objects.
##'
##' @title Access proxy age data
##'
##' @param obj an R object from which counts are to be extracted.
##' @param ... arguments passed to other methods.
##' @return Either a data frame of ages or a list of such objects.
##'
##' @author Simon Goring
##'
##' @export
##' @rdname ages
##'
##' @examples
##' \dontrun{
##' ostracodes <- get_dataset(datasettype = 'ostracode')
##'
##' ostro.dl <- get_download(ostracodes)
##' ostro.ages <- ages(ostro.dl)
##' }
`ages` <- function(obj, ...) {
UseMethod("ages")
}

##' @export
##' @rdname ages
`ages.download` <- function(obj, ...) {
ret <- as.data.frame(obj$sample.meta)
class(ret) <- c("neo_ages", "data.frame")
ret
}

##' @export
##' @rdname ages
`ages.download_list` <- function(obj, ...) {
ret <- lapply(obj, '[[', 'sample.meta')
ret <- lapply(ret, as.data.frame)
class(ret) <- c("neo_ages_list", "list")
ret
}
Loading

0 comments on commit c683998

Please sign in to comment.