Created
March 31, 2012 03:01
-
-
Save kohske/2258869 to your computer and use it in GitHub Desktop.
Nested Loop in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nested loop creation | |
s <- (Reduce(function(a, b) substitute(`for`(i, j:3, x), list(i = as.name(letters[b]), j = `if`(b == 1, 1, as.name(letters[b-1])), x = a)), 4:1, quote(print(c(a, b, c, d))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment