Learn R Programming

HGNChelper (version 0.3.4)

symbolToR: function to *reversibly* convert HGNC gene symbols to valid R names.

Description

This function reversibly converts HGNC gene symbols to valid R names by prepending "symbol.", and making the following substitutions: "-" to "hyphen", "@" to "ampersand", and "/" to "forwardslash".

Usage

symbolToR(x)

Arguments

x
vector of HGNC symbols

Value

converted to the same HGNC symbols using the rToSymbol function.

Examples

Run this code

data("hgnc.table", envir=environment())

hgnc.symbols <- as.character(na.omit(unique(hgnc.table[ ,2])))
if( !identical(all.equal(hgnc.symbols, rToSymbol(make.names(symbolToR(hgnc.symbols)))), TRUE))
     stop("HGNC mapping was not reversible.")

Run the code above in your browser using DataLab