| sclass | R Documentation |
return the classes of a list of objects
sclass(x, ...)
x |
an S3 object inheriting from class |
... |
additional parameters are ignored. |
This function takes a list and returns the classes for each
object in the list. In the event an object class has multiple values,
the returned object is a list, otherwise is a vector.
If x is an S4 object, then methods::slotNames(x) is used, and
the class is returned for each S4 slot.
When x is a data.frame, data.table, tibble, or similar
DataFrame table-like object, the class of each column is returned.
For the special case where x is an S4 object with one slotName
".Data", the values in x@.Data are coerced to a list. One
example of this case is with limma::MArrayLM-class.
When x is a matrix, the class of each column is returned for
consistency, even though the class of each column should be identical.
For more more information about a list-like object, including
the lengths/dimensions of the elements, see sdim() or ssdim().
character vector with the class of each list element, or
column name, depending upon the input class(x).
Other jam list functions:
cPaste(),
heads(),
jam_rapply(),
list2df(),
mergeAllXY(),
mixedSorts(),
rbindList(),
relist_named(),
rlengths(),
sdim(),
uniques(),
unnestList()
sclass(list(LETTERS=LETTERS, letters=letters));
sclass(data.frame(B=letters[1:10], C=2:11))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.