0

I typed codes in R to download sp package, it says -- Package ‘sp’ is not available (for R version 3.0.1).

I downloaded sp manually from http://cran.stat.ucla.edu/src/contrib/sp_1.0-9.tar.gz. Questions is: how to unpack the tar.gz file? I work with RGui in windows 7.

Thanks!!

Apple
  • 13
  • 1
  • 1
  • 4
  • Hm, I just downloaded and installed the binary via `install.packages("sp")`. I'm also using R 3.0.1 on Windows, and I even got it from the UCLA mirror just to be sure. Try again and see if it works. – Hong Ooi Jul 02 '13 at 12:34
  • `install.packages("sp")` worked for me on `RHEL 7.7` – Santosh Garole Mar 20 '20 at 07:24

3 Answers3

3

Suppose you work with RStudio, hit 'Tools' --> 'Install packages' and you're able to select the .tar.gz file from your local system.

fdetsch
  • 5,239
  • 3
  • 30
  • 58
3

If you have the file locally, then you can use the following:

R> install.packages(sp_package_path, repos=NULL, type="source")

where sp_package_path is the path to the source package (.tar.gz file).

rcs
  • 67,191
  • 22
  • 172
  • 153
1

What was the code that you entered? What was the error message that you received?

Try:

install.packages("sp")

If that fails, try:

install.packages("sp", dependencies=TRUE)

If that fails, please update your question with the exact error message.

ialm
  • 8,510
  • 4
  • 36
  • 48