[R] Numeric Column Labels in Excel Function
David Winsemius
dwinsemius at comcast.net
Wed Jan 29 00:46:41 CET 2014
On Jan 27, 2014, at 1:30 PM, Dustin Fife wrote:
> Hi all,
>
> I frequently get requests to do data analysis where the person
> references an excel column. e.g., "I want to analyze [insert complex
> variable name], located at column AAQ in Excel." I've been doing is
> gsub and inserting a part of the string for the complex variable name,
> then going from there. But, I was trying to make function that returns
> the following vector:
>
> excelVector = A, B, C, D,...AA, AB, AC...ZA, ZB, ZC,...AAA, AAB, AAC, etc.
>
> In other words, the argument would have one argument (n, or the number
> of columns), then it would return a list like that shown above. Then,
> all I would have to do is
>
> column.of.interest = which(excelVector=="AAQ")
>
> But I'm a bit stumped. The first part is easy:
>
> LETTERS[1:26]
>
> The next would probably use expand.grid, but all my potential
> solutions are pretty clunky.
Doesn't Excel still support R[n]C[m] references where n.m are integers?
--
David Winsemius
Alameda, CA, USA
More information about the R-help
mailing list