Skip to content

Instantly share code, notes, and snippets.

View kohta's full-sized avatar

Kohta Ishikawa kohta

View GitHub Profile
f <- function(x){x**2}
fgen <- function(k){
return(function(x){
f(k*x)
})
}
generatedfuncs <- lapply(c(1:4),fgen)
evaluatedfuncs <- lapply(generatedfuncs,function(g){g(1)})