Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

s4list

S4/List Conversion


Description

Convert S4 objects to lists and vice versa. Useful for declassing an S4 object while keeping track of it's class using attributes (see section S4 Class Definition Attributes below for more details). Both ListToS4 and S4ToList are recursive functions, affecting all lists/S4 objects contained as sub-lists/sub-objects.

Usage

S4ToList(object)

IsS4List(x)

ListToS4(x)

## Default S3 method:
S4ToList(object)

## S3 method for class 'list'
S4ToList(object)

Arguments

object

An S4 object

x

A list with an S4 class definition attribute

Value

S4ToList: A list with an S4 class definition attribute

IsS4List: TRUE if x is a list with an S4 class definition attribute

ListToS4: An S4 object as defined by the S4 class definition attribute

S4 Class Definition Attributes

S4 classes are scoped to the package and class name. In order to properly track which class a list is generated from in order to build a new one, these function use an attribute to denote the class name and package of origin. This attribute is stored as “classDef” and takes the form of “package:class”.


SeuratObject

Data Structures for Single Cell Data

v4.0.1
GPL-3
Authors
Rahul Satija [aut] (<https://orcid.org/0000-0001-9448-8833>), Andrew Butler [aut] (<https://orcid.org/0000-0003-3608-0463>), Paul Hoffman [aut, cre] (<https://orcid.org/0000-0002-7693-8957>), Tim Stuart [aut] (<https://orcid.org/0000-0002-3044-0897>), Jeff Farrell [ctb], Shiwei Zheng [ctb] (<https://orcid.org/0000-0001-6682-6743>), Christoph Hafemeister [ctb] (<https://orcid.org/0000-0001-6365-8254>), Patrick Roelli [ctb], Yuhan Hao [ctb] (<https://orcid.org/0000-0002-1810-0822>)
Initial release
2021-05-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.