Learn R Programming

limma (version 3.28.14)

protectMetachar: Protect Metacharacters

Description

Add backslashes before any metacharacters found in a string.

Usage

protectMetachar(x)

Arguments

x
character vector

Value

A character vector of the same length as x in which two backslashes have been inserted before any metacharacter.

Details

This function is used to protect strings containing metacharacters so that the metacharacters can be treated as ordinary characters in string matching functions operations.

See Also

An overview of LIMMA functions for reading data is given in 03.ReadingData.

Examples

Run this code
# without protectMetachar, this would be no match
grep(protectMetachar("Ch1 (mean)"),"Ch1 (mean)")

Run the code above in your browser using DataLab