Displaying 1 result from an estimated 1 matches for "valfun".
Did you mean:
evalfun
2010 Oct 13
2
list comprehension to create an arbitrary-sized list with arbitrary names/values
In python, one can do this
mydict = dict([(keyfun(x), valfun(x)) for x in mylist])
to create a dictionary with whatever keys and values we want from an
input list of arbitrary size. In R, I want to similarly create a list
with names/values that are generated by some keyfun and valfun
(assuming that keyfun is guaranteed to return something suitable as a
name...