Learn R Programming

nlist (version 0.1.1)

as.nlist: Coerce to nlist

Description

Coerce an R object to an nlist_object().

Usage

as.nlist(x, ...)

# S3 method for numeric as.nlist(x, ...)

# S3 method for list as.nlist(x, ...)

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

Arguments

x

An R object.

...

Unused

Value

An nlist object.

Methods (by class)

  • numeric: Coerce named numeric vector to nlist

  • list: Coerce list to nlist

  • data.frame: Coerce data.frame to nlist

Examples

Run this code
# NOT RUN {
as.nlist(list(x = 1:4))
as.nlist(c(`a[2]` = 3, `a[1]` = 2))
# }

Run the code above in your browser using DataLab