What I want to achieve
In order to build a generic framework i would like to build an s4 class with a slot that could be of any type. Is it possible? And if so how?
What I have found so far
I have found this question that adress the multiple types problem. But I would like to make it possible for any types not just some predefined types.
Example:
setClass("foo",
representation(
anything = "..."
)
)
# I would like to be able to perform all of these
new("foo", anything = 1)
new("foo", anything = "a")
new("foo", anything = data.frame())
...