Get the chance to pre-order new collection at the best price
http://leesle.kr/product-category/outer/
seen from South Korea

seen from Colombia
seen from China
seen from Canada

seen from United States
seen from United States
seen from United States
seen from Malaysia

seen from United States

seen from Canada

seen from Italy

seen from United States
seen from United States
seen from South Korea
seen from United States
seen from United States

seen from Malaysia
seen from United States
seen from China

seen from United States
Get the chance to pre-order new collection at the best price
http://leesle.kr/product-category/outer/
Get the chance to pre-order new collection at the best price
http://leesle.kr/product-category/outer/
R function of the day #003
outer() The math inclined know about it but some don't think of it enough. I know I didn't! Slightly generalizing the outer product to arbitrary functions is useful. A typical use is to make a high dimension tensor.
> x1=matrix(1:6,ncol=3) > x2=matrix(1:4,ncol=2) > outer(x1,x2) , , 1, 1 [,1] [,2] [,3] [1,] 1 3 5 [2,] 2 4 6 , , 2, 1 [,1] [,2] [,3] [1,] 2 6 10 [2,] 4 8 12 , , 1, 2 [,1] [,2] [,3] [1,] 3 9 15 [2,] 6 12 18 , , 2, 2 [,1] [,2] [,3] [1,] 4 12 20 [2,] 8 16 24
Pairwise combinations: Who doesn't want to make matrices like this when it is so quick and easy?
> outer(1:4,LETTERS[3:9],function(n,l) paste(n,l,sep="")) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] "1C" "1D" "1E" "1F" "1G" "1H" "1I" [2,] "2C" "2D" "2E" "2F" "2G" "2H" "2I" [3,] "3C" "3D" "3E" "3F" "3G" "3H" "3I" [4,] "4C" "4D" "4E" "4F" "4G" "4H" "4I"
A final example (with apologies for being so hetero-normative)
>girls=c( "Sookie", 'Tara', 'Arlene', "Jessica", "Pam", "Alcide Herveaux", "Holly", "Luna", "Nan", "Maxine", "Lettie Mae", "Maryann", "Rene", "Crystal", "Debbie") >boys=c( "Bill", "Sam", "Jason", "Andy", "Lafayette", "Hoyt", "Eric", "Terry", "Sheriff Bud", "Steve", "Jesus", "Tommy", 'Russell', "Mike ", "Eggs") >outer(boys,girls,paste) ...output omitted...