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

Projects
None yet
2 participants
@LTLA
Contributor

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)

This comment has been minimized.

@eddelbuettel

eddelbuettel Oct 9, 2018

Owner

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.

This comment has been minimized.

@LTLA

LTLA Oct 9, 2018

Contributor

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

Show resolved Hide resolved vignettes/rcppannoy.Rmd

@eddelbuettel eddelbuettel merged commit 8310d3a into eddelbuettel:master Oct 9, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment