Learn R Programming

extras (version 0.7.3)

as_list: As List

Description

Coerces an object to an list. All attributes are removed except any names.

Usage

as_list(x, ...)

# S3 method for default as_list(x, ...)

Value

A list.

Arguments

x

An object.

...

Other arguments passed to methods.

Examples

Run this code
as_list(1:3)
as_list(c(x = 1, y = 2))

Run the code above in your browser using DataLab