'rcpp' is not recognized as an internal or external command, operable program or batch file.

I'm trying to use Rcpp within a rmarkdown document and having some troubles. This is the error that I get:

'rcpp' is not recognized as an internal or external command,
operable program or batch file.

I tried this on Windows:

'rcpp' is not recognized as an internal or external command,
operable program or batch file.
> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] drat_0.1.4     compiler_3.5.1 tools_3.5.1    yaml_2.2.0     knitr_1.21     xfun_0.4  

and Linux:

/bin/sh: 1: rcpp: not found

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

Matrix products: default
BLAS: /usr/lib/openblas-base/libblas.so.3
LAPACK: /usr/lib/libopenblasp-r0.2.19.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=C              LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] drat_0.1.4     compiler_3.5.1 tools_3.5.1    yaml_2.2.0 

Rcpp works outside rmarkdown code chunks:

> Rcpp::evalCpp("1+2")
[1] 3

Is this a bug is something wrong with my installations?

1 Like

See the Rcpp other languages section in the R Markdown book here:

Among other things, R is case sensitive. So, if you're marking your chunks

```{rcpp}
```

versus

```{Rcpp}

```

that could be giving you trouble.

3 Likes

Thanks @mara! changing it to Rcpp made things work. Should I report the bug (Rstudio uses rccp when you add the code chunk) or is this a known issue?

What version of RStudio are you using? I reported this awhile back and it got fixed.

1 Like

My windows computer is running Version 1.1.463 and my Linux is running Rstudio Server 1.1.453

Ah, yeah, so the bug has been fixed in the preview releases:
https://www.rstudio.com/products/rstudio/download/preview/

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.