开发者

Cannot install R package in Windows 7

I was trying to install a package called ei from this link . With GCC, r-base-dev and some other R package dependencies installed, it works perfect in my Ubuntu Linux system.

Now I am trying to install the same in Windows 7 environment. So far my setup is as follows,

  1. R installed in home folder (c:\Users\username\R-2.12.1\R. It is set to run as administrator, and the R folder is writable.
  2. My working directory is (c:\Users\username\Documents)
  3. Rtool is installed in (c:\Rtools)

Having this setup,

  1. I tried to install it by the command, install.packages("ei",repos="http://r.iq.harvard.edu"). This command 开发者_如何学JAVAgives me the following error message.

Installing package(s) into ‘C:\Users\username\Documents/R/win-library/2.12’ (as ‘lib’ is unspecified) Warning message: In getDependencies(pkgs, dependencies, available, lib) : package ‘ei’ is not available

After that I have decided to have a try to install it from a local zip file, so I proceeded in the following way,

  1. I have downloaded the package ei_0.938.tar.gz, untar it and make a zip file from that. I placed it into my work directory.
  2. I opened the terminal (Run > cmd), went to the work directory and tried to run the command R COM INSTALL ei

It shows me the following error message,

C:\Users\username\Documents>R COM INSTALL ei 'R' is not recognized as an internal or external command, operable program or batch file.

I am not sure what should I do now. Is there anyone to help?

Note: I can install packages from CRAN repos.

_ RB


The second error sounds like you need to add R to your environment path. Here is what I have in my path for R, you may need to modify: C:\Program Files\R\R-2.12.0\bin\x64

Here's a blog outlining how to set your path variables.

I also had to reduce my User Account Control Settings before I could install R packages, but that may have been more to do with my machine and the network configs set by my IT department.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜