index2Numeric: Convert index to only numeric values

View source: R/protdata.R

index2NumericR Documentation

Convert index to only numeric values

Description

This function converts a vector of indices, which are a potential mixture of numeric values and accessions (characters or even factors) to a vector which retains the numeric indices, but converts accessions to their corresponding index in a provided accessions vector.

Usage

index2Numeric(i, accessions)

Arguments

i

A vector of indices (either numeric or a character or factor vector corresponding to elements in the accessions vector).

accessions

A character or factor vector containing accessions.

Value

A numeric vector containing either the original numeric values or the numeric values corresponding to the position of each element of i in the accessions vector.


statOmics/MSqRob documentation built on Dec. 8, 2022, 6 a.m.