rgdal package installation
I f you look at the package page on CRAN, you will see the following :
SystemRequirements: for building from source: GDAL >= 1.7.1 library
from http://trac.osgeo.org/gdal/wiki/DownloadSource and PROJ.4 (proj >= 4.4.9) from http://trac.osgeo.org/proj/; GDAL OSX frameworks built by William Kyngesburye at http://www.kyngchaos.com/ may be used for
source installs on OSX.
As you seem to be under Linux, you always build package from source, so you will have to install the corresponding libraries on your system. If you are under Mint, Ubuntu or another Debian derivative, you can do :
$ sudo apt-get install libgdal1-dev libproj-dev
One tip that can be useful, still under a Debian based system, is to install the apt-file
package and run :
$ sudo apt-file update
Then, when you get an error such as :
configure: error: proj_api.h not found in standard or given locations.
You can use the following command to find which package you must install to get the missing file :
$ apt-file search proj_api.h
libproj-dev: /usr/include/proj_api.h
how to install rgdal package
It should be sufficient to run install.packages('rgdal')
. R will ask you to select a mirror where the "0-Cloud [https]" mirror should work. The package rgdal is available there. The mentioned repository http://www.stats.ox.ac.uk/pub/RWin does not provide the R package.
Prompt user prior to installing R package
You can use function menu() inside an if statement to make a simple confirmation mechanism. This will work:
package <- "foo"
if (menu(c("Yes", "No"),
title= paste("Are you sure you want to install package", package)) == "1") {
install.packages(package)
} else { print("Cancelling installation")}
Related Topics
Create Group Number For Contiguous Runs of Equal Values
Index Values from a Matrix Using Row, Col Indices
R Shiny: Handle Action Buttons in Data Table
Read a Text File in R Line by Line
How to Sum a Numeric List Elements
How to Flatten/Merge Overlapping Time Periods
Increase Distance Between Text and Title on the Y-Axis
Extract the First 2 Characters in a String
Create a Data.Frame Where a Column Is a List
How to Calculate the Co-Occurrence in the Table
How to Display the Frequency At the Top of Each Factor in a Barplot in R
Get "Embedded Nul(S) Found in Input" When Reading a CSV Using Read.Csv()
Finding Percentage in a Sub-Group Using Group_By and Summarise
How to Add Layers in Ggplot Using a For-Loop
Select Subset of Columns in Data.Table R