Closed 24sharkS closed 4 years ago
@randy3k is there any function for this purpose?
That's a valid request. There is no such thing now.
The closest thing is
is.environment(d) && identical(parent.env(d), asNamespace("collections"))
But it only checks if the object is from collections
, it doesn't check if it is a dict
or other containers.
In addition to above we can also do something like this, which will confirm the type too.
strsplit(capture.output(d$print)," ")[[1]][1] == "dict"
closed by b308f8f
I am using
dict()
object in a function and want to perform check to make sure that the argument passed to the function is of dict type.The class function doesn't provide this information.
Any workaround for this issue?