Skip to content

Importing datasets from packages #29

@wahani

Description

@wahani

Hi! I'm just seeing this thread now and while thinking about using modules::import() to replicate much of R's default attached package list (which is accessible, BTW, via options()$defaultPackages), I found this oddity:
Let this be file mod.R:

modules::import("utils", attach = TRUE)
modules::import("datasets", attach = TRUE)
print(head(iris))

And in use():

modules::use("mod.R")

Gives this:

#> Error in head(iris) : object 'iris' not found

Changing the print statement to:

print(utils::head(datasets::iris))

... works. Perhaps I'm missing something about how attach = TRUE is supposed to work?

Originally posted by @mmuurr in #13 (comment)

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