我正在尝试使用Google Trends数据,并发现一些未在CRAN上的包(GTrends,RGoogleTrends)。
我喜欢从这个博客中看到的RGoogleTrends包的内容,并想尝试一下。RGoogleTrends包的位置在这里:http://www.omegahat.org/RGoogleTrends/
首先,我正在使用Windows操作系统,并且我的R控制台中有一个选项:
>Packages>Install package(s) from local zip drives ...
这将导致以下结果:
> utils:::menuInstallLocal()
Error in read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
cannot open the connection
In addition: Warning messages:
1: In unzip(zipname, exdir = dest) : error 1 in extracting from zip file
2: In read.dcf(file.path(pkgname, "DESCRIPTION"), c("Package", "Type")) :
cannot open compressed file 'RGoogleTrends_0.2-1.tar.gz/DESCRIPTION', probable reason 'No such file or directory'
我猜这可能与文件是
.gz
而不是.zip
有关。因此,我在R之外解压了.gz
文件,然后将其压缩成.zip
文件(肯定有更好的方法)。现在我可以安装.zip
文件,但当我尝试使用library
加载它时,会出现以下错误:> library(RGoogleTrends)
Error in library(RGoogleTrends) :
‘RGoogleTrends’ is not a valid installed package
我在这里做错了什么?
.gz
文件,那么我认为应该有一种方法可以加载包而不需要安装另一个程序 - 对吗?附言:我已经安装了cygwin,但从未通过它运行过R。 - Marc in the boxinstall.packages(packageName, repos = "http://www.omegahat.org/R", type = "source")
吗? - GSee