From h.wickham at gmail.com  Thu Jan 29 19:33:15 2015
From: h.wickham at gmail.com (Hadley Wickham)
Date: Thu, 29 Jan 2015 12:33:15 -0600
Subject: [Rd] names function for environments?
In-Reply-To: <CAOQ5Nyft+uRSCho4ksX9MSp9P8QJt=nup+iBQ7hkQSxTY0J=Kg@mail.gmail.com>
References: <CAGh0NYo++Gn8dPoGXXgygoGXWpZ-XjaARW9jTHAsF4cvncB+mw@mail.gmail.com>
	<21703.43677.632521.343906@stat.math.ethz.ch>
	<CAOQ5NycNg+iU31bgkD+ZXNu2NiZ2NqSEiwyar-5iqtF+8JkK1A@mail.gmail.com>
	<CAGh0NYq=Py+MkEHEwM8fkttEDEjmxTcno9xvFuzRVRjL3nNH0w@mail.gmail.com>
	<CAOQ5NyeH3tedOsd4LdxmoNXQaH0nT324huGn0FKPQ5PzZ2rBHw@mail.gmail.com>
	<21706.15088.949298.673951@stat.math.ethz.ch>
	<CAOQ5Nyft+uRSCho4ksX9MSp9P8QJt=nup+iBQ7hkQSxTY0J=Kg@mail.gmail.com>
Message-ID: <CABdHhvEGSDjRGPujBMHuQCCjAiNyThp7s6KOLDL_0vNdbAwOCA@mail.gmail.com>

> Yea, but it is super weird that as.list() filters elements out of the
> environment during coercion.
>
> I think I'm going to look through the uses of ls() inside of the core
> packages, because I suspect that is usually not necessary to extract the
> keys, and there is a cleaner (and probably faster) way to achieve the same
> result.

It would be nice to have a function that generalised over exists("x",
env = y) and "x" %in% names(y).

Hadley


-- 
http://had.co.nz/



[Rd] names function for environments?
Hadley Wickham