Skip to content

Commit 5a0ff2c

Browse files
authored
Merge pull request #231 from SimonGoring/master
Submitted 1.7.4 version for CRAN.
2 parents 192f025 + c683998 commit 5a0ff2c

File tree

172 files changed

+17298
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+17298
-6
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
^CRAN-RELEASE$
12
^.*\.Rproj$
23
^\.Rproj\.user$
34
^.*\.yml

CRAN-RELEASE

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This package was submitted to CRAN on 2019-01-03.
2+
Once it is accepted, delete this file and tag the release (commit 8a3aa68e0b).

man/compile_downloads.Rd

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/get_dataset.integer.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/get_dataset.numeric.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/get_site.numeric.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Package: neotoma
2+
Type: Package
3+
Title: Access to the Neotoma Paleoecological Database Through R
4+
Version: 1.7.4
5+
Date: 2019-01-03
6+
Encoding: UTF-8
7+
Author: Simon J. Goring [aut, cre], Gavin L. Simpson [aut], Jeremiah P. Marsicek
8+
[ctb], Karthik Ram [aut], Luke Sosalla [ctb]
9+
Authors@R: c(person(given = c("Simon", "J."), family = "Goring",
10+
role = c("aut", "cre"), email = "goring@wisc.edu"),
11+
person(given = c("Gavin", "L."), family = "Simpson", role = "aut"),
12+
person(given = c("Jeremiah", "P."), family = "Marsicek", role = "ctb"),
13+
person(given = "Karthik", family = "Ram", role = "aut"),
14+
person(given = "Luke", family = "Sosalla", role = "ctb"))
15+
Maintainer: Simon J. Goring <goring@wisc.edu>
16+
Description: Access paleoecological datasets from the Neotoma Paleoecological
17+
Database using the published API (<http://api.neotomadb.org/>). The functions
18+
in this package access various pre-built API functions and attempt to return
19+
the results from Neotoma in a usable format for researchers and the public.
20+
License: MIT + file LICENSE
21+
URL: https://github.com/ropensci/neotoma
22+
BugReports: https://github.com/ropensci/neotoma/issues
23+
Depends: R (>= 2.10)
24+
Imports: plyr, reshape2, jsonlite, httr, xml2, analogue, leaflet, dplyr
25+
Suggests: testthat, knitr
26+
RoxygenNote: 6.1.1
27+
NeedsCompilation: no
28+
Packaged: 2019-01-03 23:57:10 UTC; simon
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
YEAR: 2016
2+
COPYRIGHT HOLDER: Simon Goring
+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Generated by roxygen2: do not edit by hand
2+
3+
S3method(Stratiplot,download)
4+
S3method(Stratiplot,download_list)
5+
S3method(ages,download)
6+
S3method(ages,download_list)
7+
S3method(bind,default)
8+
S3method(browse,dataset)
9+
S3method(browse,dataset_list)
10+
S3method(browse,default)
11+
S3method(browse,download)
12+
S3method(browse,download_list)
13+
S3method(counts,download)
14+
S3method(counts,download_list)
15+
S3method(depths,default)
16+
S3method(depths,download)
17+
S3method(depths,download_list)
18+
S3method(get_chroncontrol,dataset)
19+
S3method(get_chroncontrol,dataset_list)
20+
S3method(get_chroncontrol,default)
21+
S3method(get_chroncontrol,download)
22+
S3method(get_chroncontrol,download_list)
23+
S3method(get_closest,dataset)
24+
S3method(get_closest,default)
25+
S3method(get_closest,download)
26+
S3method(get_closest,site)
27+
S3method(get_dataset,default)
28+
S3method(get_dataset,download)
29+
S3method(get_dataset,download_list)
30+
S3method(get_dataset,geochronologic)
31+
S3method(get_dataset,geochronologic_list)
32+
S3method(get_dataset,integer)
33+
S3method(get_dataset,numeric)
34+
S3method(get_dataset,site)
35+
S3method(get_download,dataset)
36+
S3method(get_download,dataset_list)
37+
S3method(get_download,default)
38+
S3method(get_download,site)
39+
S3method(get_geochron,dataset)
40+
S3method(get_geochron,dataset_list)
41+
S3method(get_geochron,default)
42+
S3method(get_geochron,site)
43+
S3method(get_publication,dataset)
44+
S3method(get_publication,dataset_list)
45+
S3method(get_publication,default)
46+
S3method(get_publication,download)
47+
S3method(get_publication,download_list)
48+
S3method(get_site,dataset)
49+
S3method(get_site,dataset_list)
50+
S3method(get_site,default)
51+
S3method(get_site,download)
52+
S3method(get_site,download_list)
53+
S3method(get_site,geochronologic)
54+
S3method(get_site,geochronologic_list)
55+
S3method(get_site,integer)
56+
S3method(get_site,numeric)
57+
S3method(plot,dataset)
58+
S3method(plot,dataset_list)
59+
S3method(plot,download)
60+
S3method(plot,download_list)
61+
S3method(plot,site)
62+
S3method(plot_leaflet,dataset)
63+
S3method(plot_leaflet,dataset_list)
64+
S3method(plot_leaflet,download)
65+
S3method(plot_leaflet,download_list)
66+
S3method(print,chroncontrol)
67+
S3method(print,dataset)
68+
S3method(print,dataset_list)
69+
S3method(print,download)
70+
S3method(print,download_list)
71+
S3method(print,geochronologic)
72+
S3method(print,geochronologic_list)
73+
S3method(print,site)
74+
S3method(taxa,download)
75+
S3method(taxa,download_list)
76+
export(ages)
77+
export(bind)
78+
export(browse)
79+
export(compile_downloads)
80+
export(compile_taxa)
81+
export(counts)
82+
export(depths)
83+
export(get_chroncontrol)
84+
export(get_closest)
85+
export(get_contact)
86+
export(get_dataset)
87+
export(get_download)
88+
export(get_geochron)
89+
export(get_publication)
90+
export(get_site)
91+
export(get_table)
92+
export(get_taxa)
93+
export(param_check)
94+
export(plot_leaflet)
95+
export(read.tilia)
96+
export(read_bacon)
97+
export(taxa)
98+
export(write_agefile)
99+
importFrom(analogue,Stratiplot)
100+
importFrom(analogue,tran)
101+
importFrom(dplyr,bind_rows)
102+
importFrom(graphics,legend)
103+
importFrom(graphics,par)
104+
importFrom(graphics,plot)
105+
importFrom(graphics,points)
106+
importFrom(httr,GET)
107+
importFrom(httr,content)
108+
importFrom(jsonlite,fromJSON)
109+
importFrom(leaflet,addCircleMarkers)
110+
importFrom(leaflet,addProviderTiles)
111+
importFrom(leaflet,leaflet)
112+
importFrom(leaflet,markerClusterOptions)
113+
importFrom(leaflet,markerOptions)
114+
importFrom(plyr,ldply)
115+
importFrom(stats,aggregate)
116+
importFrom(stats,na.omit)
117+
importFrom(utils,browseURL)
118+
importFrom(utils,write.csv)
119+
importFrom(utils,write.table)
120+
importFrom(xml2,as_list)
121+
importFrom(xml2,read_xml)
122+
importFrom(xml2,xml_attr)
123+
importFrom(xml2,xml_find_all)
124+
importFrom(xml2,xml_find_one)
125+
importFrom(xml2,xml_text)
+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
neotoma 1.7.4
2+
====================
3+
o Bug fix: `get_dataset(gpid=123) was returning an error, fix corrects the error to allow unassigned `x` variables.
4+
o Updated the allowable dataset types for searching to reflect the larger set of dataset types within Neotoma.
5+
6+
neotoma 1.7.3
7+
====================
8+
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.
9+
10+
neotoma 1.7.2
11+
====================
12+
o Bugfixes, added the `taxa` function to easily extract taxa from one or multiple download objects.
13+
14+
neotoma 1.7.1
15+
====================
16+
o Bugfix for `compile_download`, single sample downloads were failing to compile properly.
17+
18+
neotoma 1.7.0
19+
====================
20+
o Added `plot_leaflet` to allow interactive exploration of downloaded Neotoma data. Integrates with the Neotoma Explorer.
21+
o Minor bugfix for `get_download` to allow records to be sent to Neotoma and to be filtered.
22+
23+
neotoma 1.6.2
24+
====================
25+
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.
26+
o Built more robust interpolation in `read_bacon` so that age models without interpolated dates can still be imported.
27+
o `browse` now opens multiple datastes in the Neotoma Explorer at once.
28+
29+
neotoma 1.6.1
30+
====================
31+
o Bugfix
32+
o New `Stratiplot` method, using the `analogue` package to plot dataset diagrams from `download` and `download_list` objects.
33+
o Bug fixes for `write_agefile`
34+
o New function `read_bacon` to read in and integrate Bacon chronologies into `download` objects.
35+
36+
neotoma 1.6.0
37+
====================
38+
o Support for vector inputs in the `gpid` selection.
39+
o Added a `get_closest` function to find the closest datasets to a sample site.
40+
o Mostly clean-up of reported bugs by users.
41+
o Revised examples for faster check speed.
42+
43+
neotoma 1.5.1
44+
====================
45+
o Fix for datasets with empty submission dates.
46+
o Some minor (non-functional) code cleaning.
47+
o Added extra tests.
48+
49+
neotoma 1.5.0
50+
====================
51+
o More extensive testing to support multiple dataset types. Water chemistry datasets still unsupported.
52+
o Function `read.tilia` added to read Tilia (http://tiliait.com) style XML files.
53+
o Moved to using `xml2`, `httr` and `jsonlite` to support parsing.
54+
55+
neotoma 1.4.0
56+
====================
57+
o The few records without chronologies were causing errors when `get_download` was applied.
58+
o Added plot method.
59+
60+
neotoma 1.3.3
61+
====================
62+
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`.
63+
o Bugfix for issue #187, empty `dataset_list`s now return a NULL value, rather than breaking the `print` method.
64+
65+
neotoma 1.3.2
66+
====================
67+
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.
68+
69+
neotoma 1.3.1
70+
====================
71+
o Bugfix for `write_agefile`
72+
o Added a `browse` method for datasets, that will open a browser window for a specific dataset or download.
73+
o The deprecated `compile_list` function has now been removed. Use `compile_taxa` instead.
74+
75+
neotoma 1.3.0
76+
====================
77+
o Improved functionality of get_chroncontrol to allow it to deal with empty tables and work directly with download and download_list objects.
78+
79+
neotoma 1.2-0
80+
====================
81+
o Added new datasettypes for records, including water chemistry, charcoal, XRD and others.
82+
83+
neotoma 1.1-0
84+
====================
85+
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
86+
87+
neotoma 0.1
88+
====================
89+
o continued development of API implementation and working toward a common
90+
standard for data output.
91+
92+
o Continued development of tests for the package.
93+
94+
o Changed function names to singular.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#' @title Palaeoecological stratigraphic diagrams
2+
#' @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.
3+
#' @param x A \code{download} object.
4+
#' @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}.
5+
#' @param method An option for axis transformation using \code{tran} from the \code{analogue} package. \code{"none"} by default.
6+
#' @param group An ecological group from the taxon table.
7+
#' @param ... variables to be passed to \code{Stratiplot}.
8+
#' @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.
9+
#' @return A \code{trellis} object.
10+
#' @examples
11+
#' \dontrun{
12+
#' lake_o_dl <- get_download(15925)
13+
#' Stratiplot(lake_o_dl[[1]])
14+
#' }
15+
#' @importFrom analogue Stratiplot tran
16+
#'@export
17+
#'
18+
Stratiplot.download <- function(x, yaxis = "age", method = "none", group = NULL, ...) {
19+
counts <- counts(x)
20+
21+
if (!yaxis %in% c("depth", "age.older", "age.younger", "age")) {
22+
stop("You must provide a suitable variable name for the y axis.")
23+
}
24+
25+
if (!"sample.meta" %in% names(x) | all(is.na(x$sample.meta[,yaxis]))) {
26+
stop("This download has no suitable chronological or depth information.")
27+
}
28+
29+
if (!is.null(group)) {
30+
taxa <- x$taxon.list$taxon.name[x$taxon.list$ecological.group %in% group]
31+
} else {
32+
taxa <- x$taxon.list$taxon.name[!x$taxon.list$ecological.group %in% "LABO" ]
33+
34+
}
35+
36+
y <- x$sample.meta[,yaxis]
37+
38+
counts <- analogue::tran(counts[,taxa], method = method)
39+
40+
analogue::Stratiplot(counts, y, ...)
41+
42+
}
43+
44+
#' @title Palaeoecological stratigraphic diagrams
45+
#' @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.
46+
#' This function only works for \code{download_list} objects that contain a single object.
47+
#' @param x A \code{download_list} object.
48+
#' @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}.
49+
#' @param method An option for axis transformation using \code{tran} from the \code{analogue} package. \code{"none"} by default.
50+
#' @param group An ecological group from the taxon table.
51+
#' @param ... variables to be passed to \code{Stratiplot}.
52+
#' @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.
53+
#' @return A \code{trellis} object.
54+
#' @examples
55+
#' \dontrun{
56+
#' lake_o_dl <- get_download(15925)
57+
#' # This works:
58+
#' Stratiplot(lake_o_dl)
59+
#'
60+
#' lakes_o_nw <- get_download(get_site(sitename = "Lake B%"))
61+
#' # This Fails:
62+
#' # Stratiplot(lake_o_nw)
63+
#'
64+
#' }
65+
#' @importFrom analogue Stratiplot tran
66+
#' @export
67+
#'
68+
Stratiplot.download_list <- function(x, yaxis = "age", method = "none", group = NULL, ...) {
69+
if (length(x) == 1) {
70+
Stratiplot(x[[1]], yaxis = "age", method = "none", group = NULL, ...)
71+
} else {
72+
stop("You must select a single `download` object to plot.")
73+
}
74+
75+
}

0 commit comments

Comments
 (0)