开发者

R Newbie Confused about Install Packages

开发者 https://www.devze.com 2023-02-02 10:55 出处:网络
I am somewhat new to R, and I thought I understood how to install packages from CRAN mirrors and from source files, but now I am stumped.I currently am using R 2.10.0 on a Windows 7 32-bit machine.

I am somewhat new to R, and I thought I understood how to install packages from CRAN mirrors and from source files, but now I am stumped. I currently am using R 2.10.0 on a Windows 7 32-bit machine.

I want to try to use the RGoogleAnalytics package found here and am trying to follow the instructions. They instruct us to install both RCurl and the XML packages from omegahat. For example,

install.packages("RCurl", repos = "http://www.omegahat.org/R")

however this does not work, as I get the following error:

Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
  package ‘RCurl’ is not available

When I try this instead:

install.packages("RCurl", repos = "http://www.omegahat.org/R", type="source")

I get the following error after the file downloads. I previously had version 1.0 and that is restored.

trying URL 'http://www.omegahat.org/R/src/contrib/RCurl_1.5-0.tar.gz'
Content type 'application/x-gzip' length 735041 bytes (717 Kb)
opened URL
downloaded 717 Kb

* installing *source* package 'RCurl' ...
Warning in system("sh ./configure.win") : sh not found
ERROR: configuration failed for package 'RCurl开发者_运维百科'
* removing 'C:/PROGRA~1/R/R-210~1.0/library/RCurl'
* restoring previous 'C:/PROGRA~1/R/R-210~1.0/library/RCurl'

The downloaded packages are in
        ‘C:\Users\Brock\AppData\Local\Temp\Rtmpc9wt5N\downloaded_packages’
Warning message:
In install.packages("RCurl", repos = "http://www.omegahat.org/R",  :
  installation of package 'RCurl' had non-zero exit status

Without going into details, I haven't been able to use the RGoogleAnalytics package as I get the same error that is found in this post. I simply am trying to exhaust every possible option to get around the error.

Any help or insight you can provide will be greatly appreciated!


The RCurl project page on CRAN says the Windows binary is not available. The ReadMe points you to a page maintained by Professor Ripley, where he provides binaries of RCurl and several other packages that have special build needs on Windows. However, he only provides them for the most recent major revision of R, so you would need to upgrade to R-2.12.0 to install them from his page.

If you want to build packages from source on Windows, you need to install Rtools first. It looks like you haven't done that. Even if you had them installed, it will still require extra steps to build RCurl on Windows... else the Windows binary would already be on CRAN.

Your best bet is probably to upgrade R and install RCurl from Prof. Ripley's page.


You are probably missing the components to build packages under Windows:

http://www.murdoch-sutherland.com/Rtools/


According to RCurl FAQ, either

  • curl-config is not found in your path

or

  • curl-config and related devlopment libraries (libcurl) are not installed.
0

精彩评论

暂无评论...
验证码 换一张
取 消