Is it possible to have slots in a S4 class to be lists of another custom type? like
setClass("customClass",
representation(list(anotherCustomClass)
)
For those looking for an answer to this. No, there is no way to restrict a list in S4 to have elements of certain type. This actually makes sense, since lists in R are designed to contain any type of element, so why lists on S4 should be distinct?