metadata: Retrieve Metadata

View source: R/metadata.R

metadataR Documentation

Retrieve Metadata

Description

Function to retrieve metadata from an object.

Usage

metadata(x, ...)

Arguments

x

Object.

...

Other arguments (not used).

Methods

key

Functions to assign, retrieve or check an index key for a given object.

description

Assign or retrieve a text description to an object.

units

Assigns or retrieves measurement units assigned to a data object.

fmt

Functions to assigns or retrieve data formatting information to and from an object.

keyword

Functions to assign, retrieve or look up object keyword attributes.

project

Functions to retrieve or assign project identifiers to objects.

header

Function to assign and retrieve file header information associated with a data object.

Examples

# Define sample data set:
x <- data.frame(year = 2010:2014,
                site = letters[1:5],
                weight = exp(rnorm(5)),
                number = rpois(5,5))

# Define metadata attributes:
units(x, "weight") <- "kilogram"
description(x) <- c(year = "Year of sampling",
                    site = "Sampling site",
                    weight = "Weight of specimen",
                    number = "Number observed")
format(x, "year") <- "YYYY"
key(x) <- "year"
keywords(x) <- c("annual", "survey")

# Retrieve metadata:
metadata(x)


TobieSurette/gulf.metadata documentation built on Dec. 31, 2022, 5:35 a.m.