R/typed-struct.R
typed_struct.Rd
Create a typed structure
typed_struct(..., .allow_na = FALSE)
Type definitions.
Allow values to be initialized with NA.
NA
A type factory function.
Person <- typed_struct( name = "character", age = "integer" ) hanna <- Person( name = "Hanna", age = 10L ) hanna #> $name #> [1] "Hanna" #> #> $age #> [1] 10 #> inherits(hanna, "Person") #> [1] TRUE inherits(hanna, "list") #> [1] TRUE