r - Make a repeating alpha-numeric list -


I want to create a list like this:

  "A001: A048", " B001: B048 ", ...," Z001: Z048 "," AA 001: AA 048 "," BB1001: BB486 ", ... ...   

I saw, but did not understand Found

  c (sprintf ("% S001:% s048", letter, letter) Sprintf ("% s% S001:% s% s048", letter, letter, letter, letter))   

with "indexed replacement" (with my period) An example is sprintf :

  external (letter, 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 "" CC2003: 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: EE003" "EE004: EE004" "EE005: EE005" snap some pages of the output < / Code>  

and another shot with A: AF 01:48 combo:

  External (C (letter, paste ('A', letter [1: 6] September = ""), 1:48, fun = sprintf, fmt = "% 1 $ s% 1 $ s% 2 $ 03d") # --------------- ----------------- "A0101" "A2002" "A300" "# [, 1] [, 2] [, 3] [, 4] [, 5 ] [, 6] [, 7] [, 8] [1,] "A1992" A005 "" A005 "" A006 "" A007 "" A008 "" A009 "" A010 "[2,]" B 001 "" B 2002 "" B3 3 "" B 2004 "" B 2005 "" B6 2006 "" B 2007 "" B 0008 "" B 0009 ", Appetized [, 41] [, 42] [, 43] [, 44 [, 45] [, 46] [, 47] [, 48] Snap [31,] "AE 041" "AE420" "AE 043" "AE464" "AE045" "AE046" "AE047" "AE048" [32] "AF041" "AF042" "AF043" "AF044" "AF045" "AF046" "AF047" "AF048"    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -