> Duncan Murdoch
> on Mon, 12 Oct 2015 19:31:11 -0400 writes:
> On 12/10/2015 9:51 AM, Ben Bolker wrote:
>> Duncan Murdoch gmail.com> writes:
>>
BB>
> It seems odd/inconvenient to me that the
> "ignore.environment" argument of identical() only
>>
MM> but I don't think we'd want to
MM> change all.equal.language() at this point in time
Although it would be nice if all.equal looked at least at attributes of
formulas
so we did not get results like
> form <- y ~ x1 %in% x2
> all.equal(form, terms(form))
[1] TRUE
> all.equal(terms(y~x1
> William Dunlap
> on Tue, 13 Oct 2015 09:12:34 -0700 writes:
> MM> but I don't think we'd want to
> MM> change all.equal.language() at this point in time
> Although it would be nice if all.equal looked at least at attributes of
> formulas
> so we did not get results like
> > f
On Sat, Oct 10, 2015 at 1:24 AM, Uwe Ligges
wrote:
> I'd start looking at getAnywhere().
Thanks Uwe, that does indeed provides "where" information.
Unfortunately, I don't see how it will allow me to search environments
similarly/in the same order as exists/get(..., envir, inherits=TRUE)
does it.
Seems easy enough to write yourself:
where <- function(x, env = parent.frame()) {
if (identical(env, emptyenv()))
return(NULL)
if (exists(x, envir = env, inherits = FALSE))
return(env)
where(x, parent.env(env))
}
sample2 <- base::sample
where("sample2")
#>
where("samp
On Tue, Oct 13, 2015 at 4:43 PM, Hadley Wickham wrote:
> Seems easy enough to write yourself:
>
> where <- function(x, env = parent.frame()) {
> if (identical(env, emptyenv()))
> return(NULL)
> if (exists(x, envir = env, inherits = FALSE))
> return(env)
> where(x, paren
On 13.10.2015 22:39, Henrik Bengtsson wrote:
On Sat, Oct 10, 2015 at 1:24 AM, Uwe Ligges
wrote:
I'd start looking at getAnywhere().
Thanks Uwe, that does indeed provides "where" information.
Unfortunately, I don't see how it will allow me to search environments
similarly/in the same order a
Thanks Uwe and thanks Hadley. I ended up implementing:
## Emulates R internal findVar1mode() function
## https://svn.r-project.org/R/trunk/src/main/envir.c
where <- function(x, where=-1, envir=if (missing(frame)) { if (where <
0) parent.frame(-where) else as.environment(where) } else
sys.frame(fr