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

properly import non-exported functions. #3

Open
annakrystalli opened this issue Jan 27, 2018 · 6 comments
Open

properly import non-exported functions. #3

annakrystalli opened this issue Jan 27, 2018 · 6 comments

Comments

@annakrystalli
Copy link
Collaborator

Checks note (and SO discussion shows) that ::: function calling within packages is not permitted on CRAN.

To import correctly, Include details in roxygen function documentation, following

#' @importFrom utils getFromNamespace

convention and remove ::: notation in functions.

@annakrystalli
Copy link
Collaborator Author

Above method will not work.

Associated -> include copies of functions. ensure proper acknowledgement and license inclusion.

@annakrystalli
Copy link
Collaborator Author

@annakrystalli
Copy link
Collaborator Author

Still need to address:

checking dependencies in R code ... WARNING
'::' or ':::' import not declared from: ‘github’
Unexported objects imported by ':::' calls:
  ‘devtools:::github_remote’ ‘usethis:::can_overwrite’
  ‘usethis:::check_installed’ ‘usethis:::project_data’
  ‘usethis:::render_template’ ‘usethis:::uses_git’
  See the note in ?`:::` about the use of this operator.

@maelle
Copy link
Contributor

maelle commented Jun 25, 2018

in codemetar I used usethis code e.g https://github.com/ropensci/codemetar/blob/7ce13ba50a439b7b9accd8b694bd486c23685384/R/utils.R#L42

  • I added a permalink to the source

  • I used the same licence as usethis for the whole package

In the future such functions might be exported by another package (if I followed correctly 👼 ) cf e.g comment by @jennybc in this closed issue r-lib/usethis#126 (comment)

@jennybc
Copy link

jennybc commented Jun 25, 2018

Definitely get in touch about usethis functions that you wish were exported. We just exported a few more, for example, based on feedback: r-lib/usethis@979a865

@annakrystalli
Copy link
Collaborator Author

Oh yeyy! write_over() is being exported!

pkgreviewer makes use of a number of currently unxeported usethis functions as it's so much about templating, but is also meant to be interactive.

Here's the checks output:

checking dependencies in R code ... NOTE
Unexported objects imported by ':::' calls:
  ‘usethis:::can_overwrite’ ‘usethis:::check_installed’
  ‘usethis:::package_data’ ‘usethis:::render_template’
  ‘usethis:::uses_git’ ‘usethis:::write_over’

I did the same as @maelle for the whole style.R script but need to change the license! 😬

This is a lot I know. Perhaps I could take a stab at some roxygen documentation if you'd consider exporting any of the above?

I also wonder if in future, some might make sense as standalone lightweight packages of their own. eg I could see the styling functions as a useful and sensible collection. Also some functions for checking or working with project/package metadata might also make sense together.

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

No branches or pull requests

3 participants