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

Added Rcpp compilation to vignette build. #33

Merged
merged 3 commits into from
Oct 9, 2018

Conversation

LTLA
Copy link
Contributor

@LTLA LTLA commented Oct 9, 2018

No description provided.

@@ -10,6 +10,13 @@ vignette: >
%\usepackage[utf8]{inputenc}
---

```{r, echo=FALSE, results="hide"}
knitr::opts_chunk$set(error=FALSE, warning=FALSE, message=FALSE)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could set eval=FALSE globally too.

Brooke Anderson and I used that super-cleverly in the R Journal paper on using drat for a data archive -- if the optional data is not there, the knitr chunks with not evaluate. After some pretest for a package we essentially do

# Code to add at the beginning of the vignette(s) of the code package to ensure vignette
# code is conditioned to only run if the data package is available
hasData <- requireNamespace("hurricaneexposuredata", quietly = TRUE)                #1
if (!hasData) {                                                                     #2
  knitr::opts_chunk$set(eval = FALSE)                                             #3
  msg <- paste("Note: Examples in this vignette require that the",
               "`hurricaneexposuredata` package be installed. The system",
               "currently running this vignette does not have that package",
               "installed, so code examples will not be evaluated.")
  msg <- paste(strwrap(msg), collapse="\n")
  message(msg)                                                                    #4
}

I think we discuss the trick in the paper too -- the hashmarks one to four here are references.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's probably neater than having to set eval=FALSE manually.

vignettes/rcppannoy.Rmd Show resolved Hide resolved
@eddelbuettel eddelbuettel merged commit 8310d3a into eddelbuettel:master Oct 9, 2018
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

Successfully merging this pull request may close these issues.

None yet

2 participants