load_safe_data: Loads data from a SAFE dataset.

View source: R/load_safe.R

load_safe_dataR Documentation

Loads data from a SAFE dataset.

Description

This function returns a data frame containing the data from a data worksheet in a SAFE dataset. Note that SAFE dataset .xlsx files include the other (non-data) worksheets Summary, Taxa, Locations that contain metadata: see get_taxa, get_locations, add_taxa and add_locations for accessing and using this metadata.

Usage

load_safe_data(record_id, worksheet)

## S3 method for class 'safedata'
str(object, ...)

## S3 method for class 'safedata'
print(x, n = 10, ...)

Arguments

record_id

A SAFE dataset record id

worksheet

The name of the worksheet to load

...

Further arguments to str and print methods.

x, object

A safedata object.

n

The number of rows to show in the print method.

Details

In particular, the large amount of data worksheet summary metadata is not attached as attributes to the data frame returned by this function. This is largely to avoid excessive output to the console during normal use of the data frame: an extended description of a worksheet can be displayed using show_worksheet.

Currently, this function only loads data from SAFE formatted .xlsx files - data stored in external files is not yet handled.

Value

A data frame with the additional safedata class and additional attribute data containing metadata for the data.

Methods (by generic)

  • str: Display structure of a safedata data frame

  • print: Print safedata data frame

Examples

   set_example_safe_dir()
   beetle_abund <- load_safe_data(1400562, "Ant-Psel")
   str(beetle_abund)
   # See also the show_worksheet function for further worksheet metadata
   show_worksheet(beetle_abund)
   unset_example_safe_dir()

safedata documentation built on May 31, 2023, 9:01 p.m.