as_empty: Convert to an empty object

Description Usage Arguments Value See Also Examples

View source: R/as_empty.R

Description

Convert x to an empty object.

Usage

1
2
3
4
5
6
7
8
9
as_empty(x, ...)

as.empty(x, ...)

## Default S3 method:
as_empty(x, ...)

## S3 method for class 'data.frame'
as_empty(x, ...)

Arguments

x

An object.

...

Additional parameterS.

Value

An empty object

See Also

is_empty in this package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x <- c("a", "b", "c")
as_empty(x)
class(as_empty(x)) # still a character

x <- factor(LETTERS)
as_empty(x)        # levels are kept
class(as_empty(x)) # still a factor

x <- data.frame(x = 1:3, y = 2:4)
as_empty(x)

paulponcet/bazar documentation built on July 15, 2019, 5:28 a.m.