Created
November 4, 2016 19:58
-
-
Save jaye-ross/5b4d5df95351e5aa49971173ec548b03 to your computer and use it in GitHub Desktop.
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
# | |
add = function(a,b,add_func="add_func"){ | |
add_func(a,b) | |
} | |
# 0,1 with addition mod 2 | |
add_func = function(a,b){ | |
(a + b) %% 2 | |
} | |
add(0,1) | |
add(1,1) | |
# | |
add_func = function(a,b){ | |
(a + b) %% 3 | |
} | |
require(data.table) | |
n = 9 | |
l = rep(list(0:1), n) | |
d = data.table(expand.grid(l)) | |
add(d[1],d[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment