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

Make package CRAN ready #16

Open
analyticalmonk opened this issue Mar 19, 2016 · 4 comments
Open

Make package CRAN ready #16

analyticalmonk opened this issue Mar 19, 2016 · 4 comments
Assignees

Comments

@analyticalmonk
Copy link
Owner

Currently, R CMD check fails.
Update and complete documentation, and make other required changes.

@analyticalmonk analyticalmonk self-assigned this Mar 22, 2016
@analyticalmonk
Copy link
Owner Author

analyticalmonk commented May 30, 2016

Current status: Eliminated ERRORs; reduced multiple WARNINGs to a single one; single NOTE.

About the existing WARNING:

Message being returned:

checking dependencies in R code ... WARNING
Unexported object imported by a ':::' call: ‘testthat:::test_code’
  See the note in ?`:::` about the use of this operator.

Background:

The WARNING message has to do with the methodology employed for obtaining the runtime for testthat blocks. Steps employed for doing it (along with examples from code) are:

@analyticalmonk
Copy link
Owner Author

analyticalmonk commented May 30, 2016

@tdhock The only reason for using test_code() that I can make out is to evaluate the test in the original environment from which the top-most function (such as time_commit() in the above case) was called. This is in contrast to the general approach taken the testthat to evaluate tests without affecting the global state. Since you had written the testthatQuantity() function, can you explain why this approach was required?

@joshuaulrich
Copy link

A couple more "NOTE"s from running R CMD check --as-cran:

* checking R code for possible problems ... NOTE
.plot_mem: no visible global function definition for ‘png’
.plot_mem: no visible global function definition for ‘dev.off’
.plot_testMetrics: no visible global function definition for ‘png’
.plot_testMetrics: no visible global function definition for ‘dev.off’
.plot_time: no visible global function definition for ‘png’
.plot_time: no visible global function definition for ‘dev.off’
list_commits: no visible global function definition for ‘as’
plot_metrics: no visible global function definition for
  ‘capture.output’
Undefined global functions or variables:
  as capture.output dev.off png
Consider adding
  importFrom("grDevices", "dev.off", "png")
  importFrom("methods", "as")
  importFrom("utils", "capture.output")
to your NAMESPACE file (and ensure that your DESCRIPTION Imports field
contains 'methods').
* checking Rd files ... NOTE
prepare_Rd: Rperform-package.Rd:31-32: Dropping empty section \examples

The fixes should be evident, but let me know if you have questions. Here's the command I ran:

_R_CHECK_CRAN_INCOMING_=FALSE _R_CHECK_FORCE_SUGGESTS_=FALSE \
R CMD check Rperform_0.0.0.9000.tar.gz --as-cran

@tdhock
Copy link

tdhock commented Jun 6, 2016

My motivation for testthatQuantity was to copy what was implemented in the testthat package, but make some modifications that allow measuring the time of each test_that block.

To avoid that WARNING about ::: you can instead use get.

For example, instead of

testthat:::test_code()

you can use

test_code <- get("test_code", envir=asNamespace("testthat"))
test_code()

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

4 participants