# add frame.lab to mtcars and assign to new data.frame mt2
mt2 <- add_frame_lab(mtcars, frame.lab = "Data extracted from the 1974 Motor
Trend US magazine, comprising fuel consumption and 10
aspects of automobile design and performance for 32
automobiles (1973–74 models). Source: Henderson and
Velleman (1981), Building multiple regression models
interactively. Biometrics, 37, 391–411.")
get_frame_lab(mt2) # return frame.lab alongside data.frame name as a data.frame
drop_frame_lab(mt2) # remove this frame.lab
get_frame_lab(mt2) # the data.frame name now doubles as its frame label
is.null(attributes(data)[["frame.lab"]]) # the attribute is NULL
Run the code above in your browser using DataLab