regex_select: Subset columns using regular expression Subset columns from a...

View source: R/mantel-test.R

regex_selectR Documentation

Subset columns using regular expression Subset columns from a data frame if column names match the regular pattern.

Description

Subset columns using regular expression Subset columns from a data frame if column names match the regular pattern.

Usage

regex_select(prefix = NULL, suffix = NULL, regex = NULL, ..., byrow = FALSE)

prefix_with(data, chr = "", ..., byrow = FALSE)

suffix_with(data, chr = "", ..., byrow = FALSE)

contain_with(data, chr = "", ..., byrow = FALSE)

Arguments

prefix

prefix of column names.

suffix

suffix of column names.

regex

other string (or regular expression) in column names.

...

other parameters passing to grepl.

byrow

logical, if TRUE will select rows based on regex.

data

a data frame.

chr

a character used to match the column names.

Value

a data frame.

Author(s)

Hou yun

Examples

prefix_with(mtcars, "m")

Hy4m/linkET documentation built on June 30, 2023, 7:39 p.m.