mutate.SummarizedExperiment: Create or transform variables

View source: R/dplyr.R

mutate.SummarizedExperimentR Documentation

Create or transform variables

Description

mutate() adds new variables and preserves existing ones; it preserves the number of rows/cols of the input. New variables overwrite existing variables of the same name.

Usage

## S3 method for class 'SummarizedExperiment'
mutate(.data, axis, ...)

Arguments

.data

SummarizedExperiment to subset

axis

The axis to perform the operation on. Either row or col.

...

Name-value pairs of expressions, each with length 1 or the same length as the number of rows/cols in row- or colData. The name of each argument will be the name of a new variable, and the value will be its corresponding value. Use a NULL value in mutate to drop a variable. New variables overwrite existing variables of the same name. The arguments in ... are automatically quoted and evaluated in the context of the data frame. They support unquoting and splicing. See vignette("programming") for an introduction to these concepts.

Value

A SummarizedExperiment after the mutate operation

Examples

#Change the treatment time from hours to minutes
data(seq_se)
seq_se %>% mutate(col, time = (time * 60))

martijnvanattekum/cleanse documentation built on Nov. 20, 2023, 8:28 p.m.