Download Rcpp and Trial Code

I am new to R and I have a problem with Rcpp. From this URL http://www.r-bloggers.com/installing-rcpp-on-windows-7-for-r-and-c-integration/ I followed all the steps to install Rcpp. I also installed and downloaded RcppClassic and Rinside. When I try to run the suggested code:

# install packages install.packages(c("Rcpp", "rbenchmark", "inline", "Runit")) # load main two packages library(Rcpp) library(inline) # do something with Rcpp to quickly check that it works body <- ' NumericVector xx(x); return wrap( std::accumulate( xx.begin(), xx.end(), 0.0));' add <- cxxfunction(signature(x = "numeric"), body, plugin = "Rcpp") x <- 1 y <- 2 res <- add(c(x, y)) res #[1] 3 

I get the following messages:

 package 'Rcpp' successfully unpacked and MD5 sums checked Warning: cannot remove prior installation of package 'Rcpp' package 'rbenchmark' successfully unpacked and MD5 sums checked package 'inline' successfully unpacked and MD5 sums checked package 'RUnit' successfully unpacked and MD5 sums checked The downloaded binary packages are in C:\Users\Ron\AppData\Local\Temp\RtmpE3jrvo\downloaded_packages Error in library(Rcpp) : there is no package called 'Rcpp' 

It is also very strange that if I try to use the user interface and select Rcpp to boot, it will not be displayed as an option.

+5
source share
1 answer

You missed this:

 Warning: cannot remove prior installation of package 'Rcpp' 

Stop all R. sessions. Start a new one, do not download Rcpp, then try installing / updating it.

The OS you use is slightly limited in that you cannot delete shared libraries.

+14
source

Source: https://habr.com/ru/post/1201949/


All Articles