Hello everybody!
I am using GRASS 6.4.0 RC6 in ubuntu 10.04. I installed R version 2.11.1 (2010-05-31) just today. As I need GRASS and R interface for my work, I went ahead as per instructions in http://www.osgeo.org/files/journal/final_pdfs/OSGeo_vol1_GRASS-R.pdf.
Initially when I started R from within GRASS and tried the command I got the following errors:
install.packages(“spgrass6”, dependencies = TRUE)
Warning in install.packages(“spgrass6”, dependencies = TRUE) :
argument ‘lib’ is missing: using ‘/usr/local/lib/R/site-library’
Warning in install.packages(“spgrass6”, dependencies = TRUE) :
‘lib = “/usr/local/lib/R/site-library”’ is not writable
Would you like to create a personal library
‘~/R/i486-pc-linux-gnu-library/2.11’
to install packages into? (y/n) n
Error in install.packages(“spgrass6”, dependencies = TRUE) :
unable to install packages
q()
Later I started R using “sudo R” and then the following errors and warnings occurred.
install.packages(“spgrass6”, dependencies = TRUE)
Warning in install.packages(“spgrass6”, dependencies = TRUE) :
argument ‘lib’ is missing: using ‘/usr/local/lib/R/site-library’
— Please select a CRAN mirror for use in this session —
Loading Tcl/Tk interface … done
also installing the dependencies ‘rgdal’, ‘XML’
trying URL ‘http://mirror.kapook.com/cran/src/contrib/rgdal_0.6-28.tar.gz’
Content type ‘application/x-gzip’ length 1416605 bytes (1.4 Mb)
opened URL
downloaded 1.4 Mb
trying URL ‘http://mirror.kapook.com/cran/src/contrib/XML_3.1-1.tar.gz’
Content type ‘application/x-gzip’ length 779143 bytes (760 Kb)
opened URL
downloaded 760 Kb
trying URL ‘http://mirror.kapook.com/cran/src/contrib/spgrass6_0.6-20.tar.gz’
Content type ‘application/x-gzip’ length 334459 bytes (326 Kb)
opened URL
downloaded 326 Kb
- installing source package ‘rgdal’ …
gdal-config: gdal-config
./configure: line 1311: gdal-config: command not found
Error: gdal-config not found
The gdal-config script distributed with GDAL could not be found.
If you have not installed the GDAL libraries, you can
download the source from http://www.gdal.org/
If you have installed the GDAL libraries, then make sure that
gdal-config is in your path. Try typing gdal-config at a
shell prompt and see if it runs. If not, use:
–configure-args=‘–with-gdal-config=/usr/local/bin/gdal-config’ echo with appropriate values for your installation.
ERROR: configuration failed for package ‘rgdal’
- removing ‘/usr/local/lib/R/site-library/rgdal’
- installing source package ‘XML’ …
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ISO C89… none needed
checking how to run the C preprocessor… gcc -E
checking for sed… /bin/sed
checking for pkg-config… /usr/bin/pkg-config
checking for xml2-config… no
Cannot find xml2-config
ERROR: configuration failed for package ‘XML’ - removing ‘/usr/local/lib/R/site-library/XML’
ERROR: dependencies ‘rgdal’, ‘XML’ are not available for package ‘spgrass6’ - removing ‘/usr/local/lib/R/site-library/spgrass6’
The downloaded packages are in
‘/tmp/RtmpP2fUan/downloaded_packages’
Warning messages:
1: In install.packages(“spgrass6”, dependencies = TRUE) :
installation of package ‘rgdal’ had non-zero exit status
2: In install.packages(“spgrass6”, dependencies = TRUE) :
installation of package ‘XML’ had non-zero exit status
3: In install.packages(“spgrass6”, dependencies = TRUE) :
installation of package ‘spgrass6’ had non-zero exit status
The result is I am not able to use spgrass.
library(spgrass6)
Error in library(spgrass6) : there is no package called ‘spgrass6’
As an intermediate level user in terms of commands and also regarding R and GRASS packages I am not able to decide what went wrong. Can you please help me out.
Regards,
Chethan S.