50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

libbib (version 1.6.4)

set_lb_attribute: Set special libbib attribute on object

Description

Takes an object, attribute name, and a value and sets a special libbib attribute by reference

Usage

set_lb_attribute(x, type, value)

Value

Nothing, since the object is modified by reference.

Arguments

x

An object to set the attribute on

type

The name of the attribute to set. lb. will be appended to this attribute name. For example, if this argument is source, and attribute called lb.source will be set on the object with the value specified

value

The value of the attribute

Examples

Run this code
set_lb_attribute(mtcars, "source", "R built-in dataset")

versicolor <- iris[iris$Species=="versicolor", ]
set_lb_attribute(versicolor, "note", "modified built-in dataset")
attributes(versicolor)$lb.note
# [1] "modified built-in dataset"

Run the code above in your browser using DataLab