Learn R Programming

SeuratObject (version 5.0.2)

.PropagateList: Propagate a List

Description

Propagate a List

Usage

.PropagateList(x, names, default = NA)

Value

A named list where the names are present in both x and names and the values are either the values from x or default

Arguments

x

A list or character vector

names

A vector of names to keep from x

default

A default value for unassigned values of x

Examples

Run this code
.PropagateList("counts", c("RNA", "ADT", "SCT"))
.PropagateList(c("counts", "data"), c("RNA", "ADT", "SCT"))
.PropagateList("ADT", c("RNA", "ADT", "SCT"))
.PropagateList(c("RNA", "SCT"), c("RNA", "ADT", "SCT"))
.PropagateList(c("RNA", ADT = "counts"), c("RNA", "ADT", "SCT"))
.PropagateList(list(SCT = c("counts", "data"), ADT = "counts"), c("RNA", "ADT", "SCT"))
.PropagateList(list(SCT = c("counts", "data"), "ADT"), c("RNA", "ADT", "SCT"))

Run the code above in your browser using DataLab