Skip to content

Should lazy() distinguish between user-defined objects and those in packages? #76

@BillDunlap

Description

@BillDunlap

It surprises me that lazy() gives the name of an object if the object is in a [lazyloaded] package but the object itself if I've defined it locally. I think that users should not have to be concerned with such a distinction.

lazy(mean)

expr: mean
env: <environment: R_GlobalEnv>
myMean <- function(vector) base::mean(vector, na.rm=TRUE)
lazy(myMean)

expr: function (vector) ...
env: <environment: R_GlobalEnv>

lazy(mtcars)

expr: mtcars
env: <environment: R_GlobalEnv>
mtcars$guzzles <- mtcars$mpg < 25
lazy(mtcars)

expr: structure(list(mpg = c(21, 21, 22.8, 21.4, 18.7, 18.1, 14.3, ...
env: <environment: R_GlobalEnv>

packageVersion("lazyeval") # downloaded from github.com/hadley/lazyeval, 2016-07-08
[1] '0.2.0.9000'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions