excelMatch: Obtain column number or variable name from Excel named...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/excelMatch.R

Description

Obtain column number or variable name from Excel named Columns

Usage

1

Arguments

...

An Excel-like string consisting of all capital letters (e.g., "AAQ", "BZ", "RQ", "S", etc.)

n

the number of columns of the data of interest

names

the column names of the data of interest

Details

Excel columns are labeled with letters (e.g., A, B, C, ... AA, AB, AC, etc). This function accepts a string (e.g., "AAC") and returns either a number that indicates where that string falls in the sequence of excel named columns, or it returns the variable name corresponding to that column number.

Value

either a variable name or column number

Author(s)

Dustin Fife

See Also

excelCols

Examples

1
2
3
4
5
fake.names = paste("Variable", 1:1000, sep="")
# find the Variable name corresponding to AC
excelMatch("AC", names=fake.names)
# find the column number instead
excelMatch("AC", n=1000)

dustinfife/fifer documentation built on Oct. 31, 2020, 3:36 p.m.