c( sprintf("%s001:%s048", LETTERS,LETTERS),
sprintf("%s%s001:%s%s048", LETTERS,LETTERS,LETTERS, LETTERS) )
Вот пример с использованием «индексированной замены» (мой термин) с sprintf
:
outer(LETTERS, 1:26, FUN=sprintf, fmt="%1$s%1$s%2$03d:%1$s%1$s%2$03d")
# [,1] [,2] [,3] [,4] [,5]
[1,] "AA001:AA001" "AA002:AA002" "AA003:AA003" "AA004:AA004" "AA005:AA005"
[2,] "BB001:BB001" "BB002:BB002" "BB003:BB003" "BB004:BB004" "BB005:BB005"
[3,] "CC001:CC001" "CC002:CC002" "CC003:CC003" "CC004:CC004" "CC005:CC005"
[4,] "DD001:DD001" "DD002:DD002" "DD003:DD003" "DD004:DD004" "DD005:DD005"
[5,] "EE001:EE001" "EE002:EE002" "EE003:EE003" "EE004:EE004" "EE005:EE005"
snipped a couple of pages of output
И еще один снимок с комбо A: AF 1:48:
outer( c(LETTERS,paste("A",LETTERS[1:6],sep="")),
1:48,
FUN=sprintf,
fmt="%1$s%1$s%2$03d")
#-----------------------------------
# [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] "A001" "A002" "A003" "A004" "A005" "A006" "A007" "A008" "A009" "A010"
[2,] "B001" "B002" "B003" "B004" "B005" "B006" "B007" "B008" "B009"
snipped
[,41] [,42] [,43] [,44] [,45] [,46] [,47] [,48]
snipped
[31,] "AE041" "AE042" "AE043" "AE044" "AE045" "AE046" "AE047" "AE048"
[32,] "AF041" "AF042" "AF043" "AF044" "AF045" "AF046" "AF047" "AF048"