ecodata: Load and/or save a dataset

ecodataR Documentation

Load and/or save a dataset

Description

Load a dataset directly to an R object, save it as file, or both.

Usage

ecodata(subdiscipline, topic, dataset, path)

## S4 method for signature 'missing,missing,missing,missing'
ecodata()

## S4 method for signature 'character,missing,missing,missing'
ecodata(subdiscipline)

## S4 method for signature 'character,character,missing,missing'
ecodata(subdiscipline, topic)

## S4 method for signature 'character,character,character,missing'
ecodata(subdiscipline, topic, dataset)

## S4 method for signature 'character,character,character,character'
ecodata(subdiscipline, topic, dataset, path)

Arguments

subdiscipline

A string containing the name of an ecological discipline

topic

A string containing the name of an analytical topic

dataset

A string containing the name of a dataset

path

A string containing the path to save the data file

Details

This function is used to load one of the static or dynamic datasets provided by the package. It can be either loaded directly into R as an object, or it can be saved to a file by specifying the path parameter, or both.

Value

An R object

Examples

# Try running the ecodata() without any arguments. You'll get some information
# about valid options for the first parameter.
data <- ecodata::ecodata()

# Note that the function returns NULL at this point
print(data)

# Repeat this process until we get data
data <- ecodata::ecodata("Quantitative Ecology")

# Instead of NULl this time, we get the information that was printed out. It may
# or many not be useful to store in a variable for later reference without having
# to run the function again.
head(data)

# Repeat this process until we get data
data <- ecodata::ecodata("Quantitative Ecology", "Distributions")
head(data)
data <- ecodata::ecodata("Quantitative Ecology", "Distributions", "Normal Random Sets")
head(data)

# This particular data set is actually dynamically generated. This means that
# running it again should produce different results.
data <- ecodata::ecodata("Quantitative Ecology", "Distributions", "Normal Random Sets")
head(data)

andrewmarx/ecodata documentation built on April 19, 2022, 11:16 a.m.