Type: | Package |
Title: | Evolving Earth System Variables |
Version: | 0.6.1 |
Maintainer: | Adam T. Kocsis <adam.t.kocsis@gmail.com> |
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. |
License: | CC BY 4.0 |
Collate: | global.R attributes.R call.R datasets.R fetching.R info.R utility.R zzz.R |
Date: | 2023-08-17 |
BugReports: | https://github.com/chronosphere-info/r_client/issues |
Encoding: | UTF-8 |
Depends: | R (≥ 3.5.0) |
Imports: | utils, tools |
NeedsCompilation: | no |
RoxygenNote: | 7.2.3 |
Suggests: | curl, tinytest |
Packaged: | 2023-08-17 08:39:52 UTC; root |
Author: | Adam T. Kocsis |
Repository: | CRAN |
Date/Publication: | 2023-08-17 12:33:00 UTC |
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.
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.
Author(s)
Adam T. Kocsis (adam.t.kocsis@gmail.com)
Function to configure the behavior of the chronosphere package.
Description
This function will allow you to set package variables.
Usage
configure(timeout = NULL, remote = NULL, curl = NULL)
Arguments
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. |
Details
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.
Value
The function has no return value.
Examples
configure(curl=FALSE)
Download a database extract from chronosphere
remote server
Description
The function will download a list of available series from the data repository
Usage
datasets(
src = NULL,
datadir = NULL,
verbose = FALSE,
master = FALSE,
greetings = TRUE,
all = FALSE
)
Arguments
src |
|
datadir |
|
verbose |
|
master |
|
greetings |
|
all |
|
Details
The function will download a single .csv file and attach it as a data.frame
.
Value
A data.frame
class object.
Examples
# 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"))
Fetching data items
Description
Function to download and attach items from the chronosphere
archives
Usage
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,
...
)
Arguments
src |
( |
ser |
( |
ver |
( |
res |
( |
ext |
( |
class |
( |
item |
( |
datadir |
( |
verbose |
( |
call |
( |
call.expr |
( |
attach |
( |
... |
Arguments passed to item-specific loading functions. |
Details
Use the function datasets
to find available series.
Value
An object from a class that matches the 'class' coordinate of the item.
Examples
# 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)
Description
Documentation page of a series (Remote server under construction)
Usage
info(src, ser = NULL)
Arguments
src |
( |
ser |
( |
Value
The function has no return value.
Retrieve citation of data object
Description
The function prints or returns the citation string of a chosen object/item.
Usage
reference(
src,
bibtex = FALSE,
ser = NULL,
ver = NULL,
print = TRUE,
prefix = ""
)
Arguments
src |
( |
bibtex |
( |
ser |
( |
ver |
( |
print |
( |
prefix |
( |
Value
By default the function has no return value. If print=FALSE
, the function will return a reference character string.
Examples
# A locally-present object, in package's directory
one <- fetch(src="SOM-zaffos-fragmentation",
datadir=system.file("extdata", package="chronosphere"))
# its reference
reference(one)