transferAttributes: transferAttributes

transferAttributesR Documentation

transferAttributes

Description

Preserves data.frame attributes.

Usage

transferAttributes(d, dsub)

Arguments

d

A data.frame or tibble that follows RANADU conventions.

dsub

A second data.frame or tibble, often a subset of the first, with variables that all appear in the first.

Details

Given a RANADU-convention reference data.frame or tibble and a second (usually subset) data.frame, this function transfers the attributes to variables in the second from the same variables in the first. This avoids the loss of attributes that often occurs when subset data.frames are constructed.

Value

A modified tibble or data.frame with attributes added to match those in the original data.frame.

Author(s)

William Cooper


NCAR/Ranadu documentation built on Jan. 27, 2023, 1:09 a.m.