Title: | Evolving Earth System Variables |
---|---|
Description: | The implemented functions allow the query, download, and import of remotely-stored and version-controlled data items. The inherent meta-database maps data files and import code to programming classes and allows access to these items via files deposited in public repositories. The purpose of the project is to increase reproducibility and establish version tracking of results from (paleo)environmental/ecological research. |
Authors: | Adam T. Kocsis [cre, aut] , Nussaibah B. Raja [aut] , Deutsche Forschungsgemeinschaft [fnd], FAU GeoZentrum Nordbayern [fnd] |
Maintainer: | Adam T. Kocsis <[email protected]> |
License: | CC BY 4.0 |
Version: | 0.6.0 |
Built: | 2024-11-12 04:25:31 UTC |
Source: | https://github.com/chronosphere-info/r_client |
The implemented functions allow the query, download, and import of remotely-stored and version-controlled data items. The inherent meta-database maps data files and import code to programming classes and allows access to these items via files deposited in public repositories. The purpose of the project is to increase reproducibility and establish version tracking of results from (paleo)environmental/ecological research.
This is still a Release Candidate version. As is R, this is free software and comes with ABSOLUTELY NO WARRANTY. Nevertheless, notes about found bugs and suggestions are more than welcome. The chronosphere links to data and code deposited on public servers, which can be inspected using the code and data URLs of the items (codeURL
, primaryURL
and secondaryURL
in the result of datasets(master=TRUE)
). By using this package you agree that you take responsibility for the items that you download. Never run fetch()
as a superuser or with administrative privileges! Doing this can open up a security hole to be exploited in case the remote servers get hijacked.
Adam T. Kocsis ([email protected])
This function will allow you to set package variables.
configure(timeout = NULL, remote = NULL, curl = NULL)
configure(timeout = NULL, remote = NULL, curl = NULL)
timeout |
Timeout option used with default R download socket. The global default value for this is 500, which can be increased for very large files and a slow internet connection. Has no effect, when |
remote |
Character string which is the URL of the chronos server. |
curl |
Logical value of the 'curl' package variable. |
The following package-wide variables can be set.
timeout
: Positive integer. Timeout of connections in seconds when the default R sockets are used. The global setting by default is '300'.
#' remote
: Character string. URL of the chronosphere repositories, the default value is "https://github.com/chronosphere-info/chrono_arch/raw/main/"
.
curl
: Logical value. If set to TRUE
(default), the curl libraries are used to download files. If set to FALSE
(default) the default R sockets are used, which can result in timeout issues that need to be resolved manually.
The function has no return value.
configure(curl=FALSE)
configure(curl=FALSE)
chronosphere
remote serverThe function will download a list of available series from the data repository
datasets( src = NULL, datadir = NULL, verbose = FALSE, master = FALSE, greetings = TRUE, all = FALSE )
datasets( src = NULL, datadir = NULL, verbose = FALSE, master = FALSE, greetings = TRUE, all = FALSE )
src |
|
datadir |
|
verbose |
|
master |
|
greetings |
|
all |
|
The function will download a single .csv file and attach it as a data.frame
.
A data.frame
class object.
# available datasets (sources and series) - proper # index <- datasets() # all available versions and resolutions in database 'pbdb' # oneDat <- datasets(src="pbdb") ################################### # local example INCOMPLETE - does not connect to the internet ind <- datasets( datadir=system.file("extdata", package="chronosphere")) # one available archive ind <- datasets( src="SOM-zaffos-fragmentation", datadir=system.file("extdata", package="chronosphere"))
# available datasets (sources and series) - proper # index <- datasets() # all available versions and resolutions in database 'pbdb' # oneDat <- datasets(src="pbdb") ################################### # local example INCOMPLETE - does not connect to the internet ind <- datasets( datadir=system.file("extdata", package="chronosphere")) # one available archive ind <- datasets( src="SOM-zaffos-fragmentation", datadir=system.file("extdata", package="chronosphere"))
Function to download and attach items from the chronosphere
archives
fetch( src = NULL, ser = NULL, ver = NULL, res = NULL, ext = NULL, class = NULL, item = NULL, datadir = NULL, verbose = TRUE, call = FALSE, call.expr = FALSE, attach = TRUE, ... )
fetch( src = NULL, ser = NULL, ver = NULL, res = NULL, ext = NULL, class = NULL, item = NULL, datadir = NULL, verbose = TRUE, call = FALSE, call.expr = FALSE, attach = TRUE, ... )
src |
( |
ser |
( |
ver |
( |
res |
( |
ext |
( |
class |
( |
item |
( |
datadir |
( |
verbose |
( |
call |
( |
call.expr |
( |
attach |
( |
... |
Arguments passed to item-specific loading functions. |
Use the function datasets
to find available series.
An object from a class that matches the 'class' coordinate of the item.
# An actual download call # a <- fetch(src="paleomap", ser="dem") # A locally-present object, in package's directory a <- fetch(src="SOM-zaffos-fragmentation", datadir=system.file("extdata", package="chronosphere")) # call repetition fetch(a, call=TRUE)
# An actual download call # a <- fetch(src="paleomap", ser="dem") # A locally-present object, in package's directory a <- fetch(src="SOM-zaffos-fragmentation", datadir=system.file("extdata", package="chronosphere")) # call repetition fetch(a, call=TRUE)
Documentation page of a series (Remote server under construction)
info(src, ser = NULL)
info(src, ser = NULL)
src |
( |
ser |
( |
The function has no return value.
The function prints or returns the citation string of a chosen object/item.
reference( src, bibtex = FALSE, ser = NULL, ver = NULL, print = TRUE, prefix = "" )
reference( src, bibtex = FALSE, ser = NULL, ver = NULL, print = TRUE, prefix = "" )
src |
( |
bibtex |
( |
ser |
( |
ver |
( |
print |
( |
prefix |
( |
By default the function has no return value. If print=FALSE
, the function will return a reference character string.
# A locally-present object, in package's directory one <- fetch(src="SOM-zaffos-fragmentation", datadir=system.file("extdata", package="chronosphere")) # its reference reference(one)
# A locally-present object, in package's directory one <- fetch(src="SOM-zaffos-fragmentation", datadir=system.file("extdata", package="chronosphere")) # its reference reference(one)