Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my.map <- function(l, f) {
- ifelse(length(l) > 0,
- append(f(l[[1]]),
- my.map(l[-1], f)),
- list())
- }
- my.map(list(1,2,3), identity) # returns list(1); should return list(1,2,3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement