add_attr: Add attributes from one data frame to another

View source: R/add_attr.R

add_attrR Documentation

Add attributes from one data frame to another

Description

Add "map" attributes from df2 to df1.

Usage

add_attr(df1, df2)

Arguments

df1

Data frame to receive attributes.

df2

Data frame to give attributes.

Value

Data frame.

Examples

df1 <- data.frame(cars = 1:3)
df2 <- data.frame(cars = 1:3)
attr(df2$cars, "map") <- data.frame(levels = 1:3,
labels = c("Volvo", "Saab", "Opel"))
df1 <- add_attr(df1, df2)
df1$cars

swehip/shprplotfun documentation built on Oct. 21, 2022, 8:26 a.m.