Create a SafeList object

SafeList(...)

as.SafeList(x)

is.SafeList(x)

Arguments

...

A list to upgrade to SafeList, or elements to be added to a new SafeList

x

list to coerce

x

list object to be tested

Value

The resulting SafeList

a SafeList version of x

logical

Details

SafeList is a wrapper class for the normal R list. It should behave identically, except for the $ operator being overridden to require exact matches.

The constructor works identical to list(...) unless:

1) The only argument is a list, in which case the result is the same list, with its class attribute updated to include 'SafeList', or 2) The only argument is a SafeList, in which case that argument is returned unchanged

Functions

  • as.SafeList: Coerce an object to SafeList.

  • is.SafeList: Test if object is already a SafeList.