histniche: Histograms of the Ecological Niche

Description Usage Arguments Author(s) Examples

View source: R/histniche.r

Description

histniche draws histograms of the niche-environment system: an histogram of the available resource units (environment) is drawn on the same graph as an histogram of the used resource units (i.e. the niche), for comparison.

Usage

1
2
3
histniche(x, pr, type = c("h", "l"), adjust = 1,
          Acol, Ucol, Aborder, Uborder, Alwd = 1,
          Ulwd = 1, ylim, ncla = 15, ...)

Arguments

x

a data frame giving the value of environmental variables (columns) in resource units (rows, e.g. the pixels of a raster map)

pr

a vector of integers with the same length as nrow(x) (giving for example the number of detections in the pixels)

type

what type of plot should be drawn. Possible types are:
* "h" for histograms,
* "l" for kernel density estimates (see ?density).
By default, type = "h" is used. If type = "l" is used, the position of the mean of each distribution is indicated by dotted lines

adjust

if type = "l", a parameter used to control the bandwidth of the density estimate (see ?density)

Acol

color for the histograms of the available pixels

Ucol

color for the histograms of the used pixels

Aborder

if type = "h", color for the border of the histograms of the available pixels (see help(hist.default))

Uborder

if type = "h", color for the border of the histograms of the used pixels (see help(hist.default))

Alwd

if type = "l", line width for the density estimate of the available pixels

Ulwd

if type = "l", line width for the density estimate of the used pixels

ylim

the limits for the y axis

ncla

The number of classes of the histogram

...

further arguments passed to or from other methods

Author(s)

Mathieu Basille basille@ase-research.org

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 

data(puechabon)
cp <- count.points(puechabon$locs[,c("X","Y")], puechabon$kasc)
puechabon$kasc
li <- kasc2df(puechabon$kasc)
cpi <- c(cp)[li$index]

histniche(li$tab, cpi)
histniche(li$tab, cpi, ty="l")


## End(Not run)

Example output

Loading required package: ade4
Loading required package: tkrplot
Loading required package: tcltk
Loading required package: shapefiles
Loading required package: foreign

Attaching package: 'shapefiles'

The following objects are masked from 'package:foreign':

    read.dbf, write.dbf

Loading required package: sp

************************************************
************************************************
THE PACKAGE adehabitat IS NOW DEPRECATED!!!!!!!
 It is dangerous to use it, as bugs will no longer be corrected.
It is now recommended to use the packages adehabitatMA, adehabitatLT, adehabitatHR, and adehabitatHS.
These 4 packages are the future of adehabitat.
 They have a vignette explaining in detail how they can be used.
They implement more methods than adehabitat
They are based on the more common and more clever spatial classes implemented in sp.
Bugs are corrected frequently.
Really, avoid to use the classical adehabitat, unless you have a very good reason for it.

*****THIS IS THE VERY LAST WARNING*****
 This is the last version of adehabitat submitted to CRAN (at the time of writing: 2015-03-27).
 THE NEXT VERSION OF adehabitat WILL JUST BE A VIRTUAL PACKAGE LOADING ALL THE PACKAGES DESCRIBED ABOVE.

Warning messages:
1: no DISPLAY variable so Tk is not available 
2: loading Rplot failed 
Raster map of class "kasc":
Cell size:  100 
Number of rows:  121 
Number of columns:  111 

Variables measured:
1. Elevation: numeric
2. Aspect: factor
3. Slope: numeric
4. Herbaceous: numeric

Warning message:
In histniche(li$tab, cpi, ty = "l") :
  Type = 'l' is not possible for factors, type = 'h' used instead.

adehabitat documentation built on Jan. 28, 2018, 5:02 p.m.