# Define an inner record type
Record <- create_list_type(list(id = Numeric, name = String))
# Now require a list of records
Records <- ListOf(Record)
records %:% Records %<-% list(
list(id = 1, name = "a"),
list(id = 2, name = "b")
)
# fixed-size list of ten records
TenRecs <- Records[10]
# will throw if length != 10
Run the code above in your browser using DataLab