From chairmank at gmail.com  Wed Oct 13 21:26:51 2010
From: chairmank at gmail.com (Steve Kim)
Date: Wed, 13 Oct 2010 12:26:51 -0700
Subject: [Rd] list comprehension to create an arbitrary-sized list with
	arbitrary names/values
Message-ID: <AANLkTik7xjr5TaH1AcFtg5cUJkTg2cfEPGy8i-RT69GY@mail.gmail.com>

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). How can I do this?



[Rd] list comprehension to create an arbitrary-sized list with arbitrary names/values
Steve Kim