rename.datasets: Rename datasets, params, locations, and columns

Description Usage Arguments Value Examples

View source: R/rename.R

Description

Provides a convenient way to rename datasets, params, locations, and columns such that their usage with a mudata object remains consistent.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
rename.datasets(md, ..., apply_to = c("data", "locations", "params",
  "datasets", "columns"), warn_missing = TRUE)

rename.params(md, ..., apply_to = c("data", "params"), warn_missing = TRUE)

rename.locations(md, ..., apply_to = c("data", "locations"),
  warn_missing = TRUE)

## S3 method for class 'mudata'
rename.cols(.data, ..., apply_to = c("datasets", "locations",
  "params", "data", "columns"), warn_missing = FALSE,
  warn_duplicated = TRUE)

Arguments

md

A mudata object

...

Key/value pairs in the form "oldvalue"="newvalue"

apply_to

The tables which the rename operation should consider

warn_missing

Print a message if any old names are not actually present

.data

A mudata object

warn_duplicated

Print a message if any name appears more than once in x after the operation.

Value

A modified mudata object.

Examples

1
2
3
4
5
6
7
8
9
data(kentvillegreenwood)
md2 <- rename.datasets(kentvillegreenwood, ecclimate="avalley")
validate.mudata(md2)
md2 <- rename.locations(kentvillegreenwood, "GREENWOOD A"="Greenwood")
validate.mudata(md2)
md2 <- rename.params(kentvillegreenwood, maxtemp="Maximum Temperature")
validate.mudata(md2)
md2 <- rename.cols(kentvillegreenwood, latitude="lat", longitude="lon")
validate.mudata(md2)

mudata documentation built on Nov. 17, 2017, 7:30 a.m.