as.keyvalue.list {decoder}R Documentation

Coerce a list to keyvalue object

Description

x should be a list with properties descrobed in section "Details".

Usage

## S3 method for class 'list'
as.keyvalue(x, ...)

Arguments

x

a list with properties described in the details section.

...

further arguments passed to as.keyvalue.

Details

Value

The function returns an object of class keyvalue (and list.

See Also

as.keyvalue

Examples


ex <- list(
 fruit  = c("banana", "orange", "kiwi"),
 car    = c("SAAB", "Volvo", "taxi", "truck"),
 animal = c("elefant")
)
as.keyvalue(ex)
is.keyvalue(ex)


# An invalid list (non unique names; not because of silly classification)
ex2 <- list(
 fruit  = c("banana", "orange", "kiwi"),
 car    = c("SAAB", "Volvo", "taxi", "truck"),
 animal = c("elefant"),
 fruit  = c("President_Obama")
)
as.keyvalue(ex2)

# An invalid list (non unique keys; kiwi appear twice)
ex3 <- list(
 fruit  = c("banana", "orange", "kiwi"),
 car    = c("SAAB", "Volvo", "taxi", "truck"),
 animal = c("elefant", "kiwi")
)
as.keyvalue(ex3)


[Package decoder version 1.1.12 Index]