add_class: Add to object helpers

Description Usage Arguments Functions Examples

View source: R/add_class.R

Description

These function make using pipe functions easier when altering an object.

Usage

1
2
3
4
5
6
7

Arguments

x

object to alter

new

new characteristic

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# set versions will replace anything already there.
a <- set_class(TRUE, 'example')
a <- set_comment(a, 'this is an example of setting a comment')

# Add version will add to `c()` anything there.
b <- add_class(a, 'ex123')
b <- add_comment(b, 'but you can also add more information')

class(a)
class(b)

comment(a)
comment(b)

cursory documentation built on Aug. 22, 2019, 9:03 a.m.