Difference between revisions of "R statistics"

From GRASS-Wiki
Jump to navigation Jump to search
(updated some contents about spgrass6)
Line 1: Line 1:
'''Q:''' How do I enjoy high quality statistic analysis in GRASS?
'''Q:''' How do I enjoy high quality statistic analysis in GRASS?


'''A:''' Well, GRASS has got an interface to the most powerful statistics analysis package around: R-stats (http://www.r-project.org)
'''A:''' Well, GRASS has got an interface to the most powerful statistics analysis package around: '''''R''''' (http://www.r-project.org)


First of all you need to add R to your system, the R version must be >= 1.9.1:
First of all you need to add '''''R''''' to your system, the '''''R''''' version must be >= 1.9.1:


'''Debian GNU/Linux''' user, if you usually upgrade your system with apt-get, add to file /etc/apt/sources.list the line:
* '''Debian GNU/Linux''' user, see: http://cran.r-project.org/bin/linux/debian/README
* '''Ubuntu Linux''' see: http://cran.r-project.org/bin/linux/ubuntu/README
* '''RedHat, Suse, Mandrake''' and similar distros: take the latest '''''R''''' RPM and install it


deb http://cran.r-project.org/bin/linux/debian woody main
Once you have '''''R''''' in your system, take a look at http://grass.itc.it/statsgrass/grass_r_install.html.


or point it to a mirror site near you. Then run 'apt-get update' and 'apt-get upgrade', this will upgrade all debian packages (including R, with the newest release). Michele.


'''RedHat, Suse, Mandrake''' and similar distros: take the latest R rpm and install it


Once you have R in your system, take a look at http://grass.itc.it/statsgrass/grass_r_install.html. For the impatient just start it:
For the impatient just start it:


<pre>
<pre>
Line 28: Line 28:
* Connecting R to RDBMS: http://grass.itc.it/statsgrass/r_and_dbms.html
* Connecting R to RDBMS: http://grass.itc.it/statsgrass/r_and_dbms.html
* Using GRASS and R: http://grass.itc.it/statsgrass/grass_r_interface.html
* Using GRASS and R: http://grass.itc.it/statsgrass/grass_r_interface.html
 
* [http://r-spatial.sourceforge.net/ Spatial data in R] (<code>sp</code>) is a '''''R''''' library that provides classes and methods for spatial data (points, lines, polygons, grids), and to new or existing spatial statistics '''''R''''' packages that use sp, depend on sp, or will become dependent on <code>sp</code>, such as <code>maptools</code>, <code>rgdal</code>, <code>splancs</code>, '''<code>spgrass6</code>''', <code>gstat</code>, <code>spgwr</code> and many others.
* [http://grass.itc.it/newsletter/grassnews3.html GRASS News vol.3], June 2005 (R. Bivand. Interfacing GRASS 6 and R. ''GRASS Newsletter'', 3:11-16, June 2005. ISSN 1614-8746).
* OSGeo Journal vol. 1 May 2007 (R. Bivand. Using the R— GRASS interface. ''OSGeo Journal'', 1:31-33, May 2007. ISSN 1614-8746).


[[Category:Installation]]
[[Category:Installation]]
[[Category:FAQ]]
[[Category:FAQ]]

Revision as of 18:29, 26 April 2007

Q: How do I enjoy high quality statistic analysis in GRASS?

A: Well, GRASS has got an interface to the most powerful statistics analysis package around: R (http://www.r-project.org)

First of all you need to add R to your system, the R version must be >= 1.9.1:

Once you have R in your system, take a look at http://grass.itc.it/statsgrass/grass_r_install.html.


For the impatient just start it:

> R

#and install packages directly from the net
pkgs <- c('akima', 'spgrass6', 'RODBC', 'VR')

install.packages(pkgs, dependencies=TRUE, type='source') 

See also:

  • Connecting R to RDBMS: http://grass.itc.it/statsgrass/r_and_dbms.html
  • Using GRASS and R: http://grass.itc.it/statsgrass/grass_r_interface.html
  • Spatial data in R (sp) is a R library that provides classes and methods for spatial data (points, lines, polygons, grids), and to new or existing spatial statistics R packages that use sp, depend on sp, or will become dependent on sp, such as maptools, rgdal, splancs, spgrass6, gstat, spgwr and many others.
  • GRASS News vol.3, June 2005 (R. Bivand. Interfacing GRASS 6 and R. GRASS Newsletter, 3:11-16, June 2005. ISSN 1614-8746).
  • OSGeo Journal vol. 1 May 2007 (R. Bivand. Using the R— GRASS interface. OSGeo Journal, 1:31-33, May 2007. ISSN 1614-8746).