pgirmess & pgirbric
Miscellaneous functions for data handling and analysis in ecology

Patrick Giraudoux

R Packages

pgirmess is a set of tools for reading, writing and transforming spatial and seasonal data in ecology, model selection and specific statistical tests. It includes functions to discretize polylines into regular point intervals, link observations to those points, compute geographical coordinates at regular intervals between waypoints, read subsets of big rasters, compute zonal statistics or table of categories within polygons or circular buffers from raster. The package also provides miscellaneous functions for model selection, spatial statistics, geometries, writing data.frame with Chinese characters, and some other functions for field ecologists.They have been used in the course of on going research carried out at the Department of Chrono-environment of the University of Franche-Comté, as and when required, sometimes with several contributors (mentioned in the documentation). The version under development can be downloaded on GitHub.  The stable version and a pdf reference manual are can be downloaded on CRAN. The package name comes from the acronym Patrick GIRaudoux MESS (the contents reality and an indirect hommage to more essential packages, eg MASS, etc.). We do the best we can to optimise each function and pgir must be blamed for any misworking.

pgirbric is a package with functions not intended to be published on CRAN for some reasons (eg too much device specific or still to improve or deprecated in other packages, etc.). It can however be downloaded on GitHub. The name is an acronym of Patrick GIRaudoux BRIColage, the latter a French name for 'do-it-yourself' which may be another kind of mess, or for BRICk, some functions seen as brick to build something more general later. Same comments as above about misworkings.

Download the package:
  pgirmess on CRAN

    kruskalmc and Siegel & Castellan (1988)
I am often asked which procedure is used for multiple comparisons in kruskalmc.  You'll find a citation of "Siegel and Castellan (1988) Non parametric statistics for the behavioural sciences. MacGraw Hill Int., New York. pp 213-214"  here.
     pgirmess install on linux (e.g. linux mint 14, 23.02.2013)

In some versions of linux, I have got reports of pgirmess "failing to install correctly". This is  generally not due to pgirmess (however see daily checks on CRAN) but most often to a defective installation of gdal (which pgirmess and rgdal depends on) within linux. 
Careful solution:

1 - in linux (synaptic or similar software), first install:
- proj-devel lib & dependencies
- libgdal1-dev lib & dependencies
2 - then, in R, install
- pgirmess & dependencies (including rgdal)

pgirmess under development:  pgirmess on GitHub

You can also install the version under development directly from R with those commands:

install.packages("devtools") # only if package 'devtools' is not already installed

        CHANGES describes the latest changes

Download the package: pgirbric on GitHub

You can also install pgirbric directly from R with those commands:

install.packages("devtools") # only if package 'devtools' is not already installed

        CHANGES describes the latest change

Working prototypes of shell scripts to run within GRASS 63 or > 

Those files must be copied into a folder visible with  PATH  eg. under linux have a "scripts" folder in your home directory and add GRASS_ADDON_PATH=~/scripts to /usr/lib/grass/etc/  To specify rights e.g. chmod a+x r.what.buff2 before running it may be necessary.

r.what.vbuff2  generates a text file of the frequency of each category
of a raster map within various radius buffers computed on vector point sites. A circular buffer is created around each point location of the vector file and the final output is text file of 4 columns: col 1 = radius, col 2 = point ID, col 3 = pixel category value, col 4 = pixel count corresponding to this value.  Category * is the null value.

r.what.vpoly  permits to generate a text file of the frequency of each category of a raster map for areas covered by polygon vector objects. The output is a text file of 3 columns: col 1 = polygon ID number, col 2 = category value, col 3 = pixel count corresponding to this category.  Category * is the null value.

Those prototypes have their equivalent in R, package pgirmess >= 1.4.5 with the functions  rwhatbufCat, rwhatbufNum and rwhatpoly

r.what.vbuff2 (7 ko)

r.what.vpoly (5 ko)