merge_exprs: Partially replace exprs field with new values

View source: R/transformations.R

merge_exprsR Documentation

Partially replace exprs field with new values

Description

Replaces a subset of data in exprs of an object by new values. Used after an operation such as imputation is computed only for a subset of features or samples such as only good-quality features that have not been flagged. This function is mainly used internally, but can be useful.

Usage

merge_exprs(object, y)

Arguments

object

a MetaboSet object

y

matrix containing new values to be merged into exprs

Value

a MetaboSet object with the new exprs values

Examples

ex_set <- merged_sample[1:5, 1:5]
exprs(ex_set)
# Create a matrix of replacment values for rows 1, 3, 5 and columns 1, 3, 4
replacement <- matrix(1:9,
  ncol = 3,
  dimnames = list(
    featureNames(ex_set)[c(1, 3, 5)],
    sampleNames(ex_set)[c(1, 3, 4)]
  )
)
replacement
merged <- merge_exprs(ex_set, replacement)
exprs(merged)


antonvsdata/notame documentation built on Sept. 14, 2024, 11:09 p.m.