You can use ls
and get
to get the objects and do.call
to call your function with the content of the objects as arguments:
sapply(ls(pattern="list_*"), function(x) do.call(my.foo, get(x)))
# list_2 list_a
# 25 11
If you instead wanted to provide a list of objects to operate on:
objs <- list(list_a, list_2)
unlist(lapply(objs, function(x) do.call(my.foo, x)))
# [1] 11 25