1

I want to use google trends in R but it won't even load the package. I tried fixing it with a couple of solutions from similar posts:

  1. Error in loadNamespace(name) : there is no package called 'Rcpp'

  2. lib unspecified & Error in loadNamespace

Here is the code:

> install.packages(gtrendsR)
Error in install.packages : object 'gtrendsR' not found
> install.packages("gtrendsR")
Installing package into ‘C:/Users/Rafael/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/gtrendsR_1.3.4.zip'
Content type 'application/zip' length 1067912 bytes (1.0 MB)
downloaded 1.0 MB

package ‘gtrendsR’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Rafael\AppData\Local\Temp\Rtmp4iqNMv\downloaded_packages
> library("gtrendsR")
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
there is no package called ‘Rcpp’
Error: package or namespace load failed for ‘gtrendsR’
Community
  • 1
  • 1
Rafael Martínez
  • 335
  • 1
  • 2
  • 17
  • In a fresh R session, could you try: `install.packages("gtrendsR",dependencies=TRUE)` to ensure all the dependencies are installed as well – Silence Dogood Oct 18 '16 at 18:35

3 Answers3

2

On Mac, ran below commands and it worked.

install.packages("readr")
install.packages("colorspace")
install.packages("vctrs")
install.packages("gtrendsR")
Abhishake Gupta
  • 2,939
  • 1
  • 25
  • 34
0

There is some confusion going on your machine. While I am involved with both packages, gtrendsR does NOT (directly) depend on Rcpp.

You can see that by following the links above to see the Depends: and Imports:

One thing you could try is to load the various packages that gtrendsR depends on see where the error creeps in.

All packages are on CRAN and you should have no difficulty sorting your machine out.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
0

you need to hit the install command for R

install.packages("readr")

after installation ..

miken32
  • 42,008
  • 16
  • 111
  • 154