Learn R Programming

assertive (version 0.2-6)

strip_attributes: Strip all attributes from a variable.

Description

Strips all the attributes from a variable.

Usage

strip_attributes(x)

Arguments

x
Input to strip.

Value

  • x, without attributes.

Examples

Run this code
x <- structure(c(foo = 1, bar = 2), some_attr = 3)
x2 <- strip_attributes(x)
assert_is_identical_to_false(has_names(x2), TRUE)
assert_is_null(attr(x2, "some_attr"))

Run the code above in your browser using DataLab