merge_exprs: Partially replace exprs field with new values

Description Usage Arguments Value Examples

View source: R/transformations.R

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

1
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

1
2
3
4
5
6
7
8
9
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/amp documentation built on Jan. 8, 2020, 3:15 a.m.