| int2col | R Documentation |
int2col() performs the inverse operation of col2int(), transforming numeric
column indices into their corresponding spreadsheet-style character labels
(e.g., 1 to "A", 28 to "AB"). This is essential for converting calculated
indices back into a format compatible with spreadsheet cell referencing.
int2col(x)
x |
A numeric vector representing the column indices to be converted. |
The function accepts a numeric vector and maps each integer to its positional representation in a base-26 derived system. This mapping follows standard spreadsheet conventions where the sequence progresses from "A" through "Z", followed by "AA", "AB", and so forth.
Validation is performed to ensure the input is numeric and finite. In accordance with the Office Open XML specification used by most spreadsheet software, the maximum supported column index is 16,384, which corresponds to the column label "XFD". Inputs exceeding this range may result in coordinates that are incompatible with standard spreadsheet applications.
A character vector of spreadsheet column labels. Returns NULL
if the input x is NULL.
Non-integer numeric values will typically be coerced or truncated; however, infinite values will trigger an error to prevent invalid coordinate generation.
col2int()
# Convert a single index
int2col(27)
# Convert a sequence of indices
int2col(1:10)
# Handle large column indices
int2col(c(702, 703, 16384))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.