r - collapse a list of unevaluated expressions to single expression -
having following list of unevaluated expressions.
l = list(quote(f()),quote(g()),quote(h())) str(l) #list of 3 # $ : language f() # $ : language g() # $ : language h() i collapse list using & function following r result.
r = quote(f() & g() & h()) str(r) # language f() & g() & h() of course point handle list of length.
you can use reduce this:
reduce(function(a,b) bquote(.(a) & .(b)), l)
Comments
Post a Comment