Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement namespace functions #17

Open
ErdaradunGaztea opened this issue Sep 4, 2022 · 2 comments
Open

Implement namespace functions #17

ErdaradunGaztea opened this issue Sep 4, 2022 · 2 comments
Assignees
Labels
new feature New feature or request

Comments

@ErdaradunGaztea
Copy link
Collaborator

Add another type of functions, wood_xxx_namespace(). They would extract both exports and imports from NAMESPACE file. The return object would have a class so that several methods could be implemented (e.g. extraction of exported names, squashing several namespaces, etc.).

Why though? Because I've got a plan for a package and it would work better to place this functionality in woodendesc.

Not needed for the release, might wait until update to plan the API better.

@ErdaradunGaztea ErdaradunGaztea added the new feature New feature or request label Sep 4, 2022
@ErdaradunGaztea ErdaradunGaztea self-assigned this Sep 4, 2022
@ErdaradunGaztea
Copy link
Collaborator Author

ErdaradunGaztea commented Sep 15, 2022

  • Use list structure
  • Implement as.data.frame() (and as_tibble())
  • Implement filters, e.g. pick_imports()

See: https://r-pkgs.org/Metadata.html#sec-namespace

The list should contain the following elements:

  • import — a character vector of imported whole packages
  • import_from — a data frame with two columns: source package and imported function (perhaps using a different name to avoid using an R keyword)
  • export — a character vector of exported function names (variable names actually)
  • S3_method — a data frame with two columns: function and class (again, work on avoiding keywords)
  • perhaps additional elements for imported and exported S4 classes and methods (four elements in total)
  • what about dyn_library?
  • what about exclude parameter in imports?

@ErdaradunGaztea
Copy link
Collaborator Author

Note that R-universe stores _exports field in its API response, that's nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant