letter-num-conversion: Convert between letter and integer representations of column...

Description Usage Arguments Details Value Examples

Description

Convert "A1"-style column IDs from a letter representation to an integer, e.g. column A becomes 1, column D becomes 4, etc. Or go the other way around.

Usage

1
2
3

Arguments

x

a character vector of "A1" style column IDs (case insensitive)

y

a vector of integer column IDs

Details

Value

a vector of column IDs, either character or integer

Examples

1
2
3
4
5
6
7
8
letter_to_num('Z')
letter_to_num(c('AA', 'ZZ', 'ABD', 'ZZZ'))
letter_to_num(c(NA, ''))
num_to_letter(28)
num_to_letter(900)
num_to_letter(18278)
num_to_letter(c(25, 52, 900, 18278))
num_to_letter(c(NA, 0, 4.8, -4))

Example output

[1] 26
[1]    27   702   732 18278
[1] NA NA
[1] "AB"
[1] "AHP"
[1] "ZZZ"
[1] "Y"   "AZ"  "AHP" "ZZZ"
[1] NA  NA  "D" NA 

cellranger documentation built on May 2, 2019, 11:26 a.m.