Skip to content
Prev 19666 / 63421 Next

problem with as.table (PR#8652)

I.J.Wilson at ncl.ac.uk writes:
You can add dimnames to b or the original matrix for a workaround.

Probably the easiest fix is (in as.table.default) to replace

 LETTERS[seq(length = dim(x)[i])]

with 

 make.unique(LETTERS[seq(from=0, length = dim(x)[i]) %% 26 + 1], sep="")

The effect would be like
[1] "A"  "B"  "C"  "D"  "E"  "F"  "G"  "H"  "I"  "J"  "K"  "L"  "M"  "N"  "O"
[16] "P"  "Q"  "R"  "S"  "T"  "U"  "V"  "W"  "X"  "Y"  "Z"  "A1" "B1" "C1" "D1"
[31] "E1" "F1" "G1" "H1" "I1" "J1" "K1" "L1" "M1" "N1" "O1" "P1" "Q1" "R1" "S1"
[46] "T1" "U1" "V1" "W1" "X1" "Y1" "Z1" "A2" "B2" "C2" "D2" "E2" "F2" "G2" "H2"

Users might prefer a different scheme, but wouldn't really deserve
it... (If they want otherwise, they can just set it themselves).