Learn R Programming

bazar (version 1.0.11)

as.empty: Convert to an empty object

Description

Convert x to an empty object.

Usage

as.empty(x, ...)

# S3 method for default as.empty(x, ...)

# S3 method for data.frame as.empty(x, ...)

Arguments

x

An object.

...

Additional parameterS.

Value

An empty object

See Also

is.empty in this package.

Examples

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab