sp package installation problem


### Error Information:

**Description of issue** - 

**Steps taken so far** - 

#### System Information:
- RStudio Edition: (Desktop or Server)
- RStudio Version: 
- OS Version: 
- R Version: 

#### Also:
<!-- Depending on your issue, the following may be useful /-->
<!-- If a section isn't relevant or you can't collect it just delete that section below /-->
- RStudio diagnostics report: <!--see rstd.io/support-diagnostics-report /-->
- Your `sessionInfo()`:
- RStudio crash report: <!-- rstd.io/support-crash-report /-->
- RStudio application log files: <!-- rstd.io/support-ide-log-files /-->

------------
From [Troubleshooting Guide: Using RStudio](https://support.rstudio.com/hc/en-us/articles/200488498-Troubleshooting-Guide-Using-RStudio)

I am receiving the error:
library("INLA")
Error: package ‘sp’ required by ‘INLA’ could not be found
I can't install sp package properly

Well, there's an immediate answer, which is that INLA isn't on CRAN, so you have to install it thusly

install.packages("INLA", repos=c(getOption("repos"), INLA="https://inla.r-inla-download.org/R/stable"), dep=TRUE)

But that shouldn't prevent you from

install.packages('sp')

first, since sp relies on some related packages to INLA but not that package itself.

But BIG caveat. If you are just getting started with geospatial analysis, sp is on its way out. It's own creators and maintainers are replacing it with sf, which is much easier to work with. Unless you have a compelling need for sp, I'd suggest starting off with sf.

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.