Learn R Programming

dynutils (version 1.0.11)

add_class: Add class to object whilst keeping the old classes

Description

Add class to object whilst keeping the old classes

Usage

add_class(x, class)

Arguments

x

a R object

class

A character vector naming classes

Examples

Run this code
library(purrr)
l <- list(important_number = 42) %>% add_class("my_list")

Run the code above in your browser using DataLab