Skip to contents

Typed list ensures all items in the list are of the same type. However, ducktyping takes place, which is if the element has target class it doesn't mean that it has the same structure as other items in the list.

Usage

as.typed_list(x, type_class)

Arguments

x

input object

type_class

generic class name of elements in the list

Value

typed list with appropriate type assigned