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

"Insert" Rcpp code chunk in RMarkdown uses "rcpp" not "Rcpp" which doesn't work #2419

Closed
DavisVaughan opened this issue Mar 16, 2018 · 1 comment

Comments

@DavisVaughan
Copy link

@DavisVaughan DavisVaughan commented Mar 16, 2018

RStudio version 1.1.423, Mac

  • File -> New File -> R Markdown...
  • Insert -> Rcpp
  • For me, the code chunk looks like:
```{rcpp}

```

Running something like the chunk below fails with /bin/sh: rcpp: command not found.

```{rcpp}
#include <Rcpp.h>
using namespace Rcpp;

// [[Rcpp::export]]
NumericVector timesTwo(NumericVector x) {
  return x * 2;
}
```

Changing it to Rcpp not rcpp works fine. I assume this has to do with the fact that Rcpp is used as the knit engine, not rcpp.

> names(knitr::knit_engines$get())
 [1] "awk"       "bash"      "coffee"    "gawk"      "groovy"    "haskell"   "lein"      "mysql"     "node"      "octave"    "perl"      "psql"     
[13] "Rscript"   "ruby"      "sas"       "scala"     "sed"       "sh"        "stata"     "zsh"       "highlight" "Rcpp"      "tikz"      "dot"      
[25] "c"         "fortran"   "fortran95" "asy"       "cat"       "asis"      "stan"      "block"     "block2"    "js"        "css"       "sql"      
[37] "go"        "python"    "julia"  
@DavisVaughan
Copy link
Author

@DavisVaughan DavisVaughan commented Mar 16, 2018

Potentially relevant line

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

No branches or pull requests

3 participants