Package 'EnvNicheR'

Title: Niche Estimation
Description: A plot overlying the niche of multiple species is obtained: 1) to determine the niche conditions which favor a higher species richness, 2) to create a box plot with the range of environmental variables of the species, 3) to obtain a list of species in an area of the niche selected by the user and, 4) to estimate niche overlap among the species.
Authors: Castor Guisande Gonzalez
Maintainer: Castor Guisande Gonzalez <[email protected]>
License: GPL (>= 2)
Version: 1.5
Built: 2024-12-01 08:00:42 UTC
Source: CRAN

Help Index


Presence of terrestrial carnivores of the family Felidae and environmental variables.

Description

Presence of terrestrial carnivores of the family Felidae and mean of environmental variables in cells of 1 degree x 1 degree around the world.

Usage

data(Carnivores)

Format

A matrix of the presence of terrestrial carnivores of the family Felidae and the mean altitude, mean annual temperature, isothermality, temperature seasonality and mean annual precipitation in cells of 1 degree x 1 degree around the world.

Source

The range maps of the species were obtained from the International Union for Conservation of Nature (IUCN) at the web page https://www.iucn.org/. The data of the mean annual temperature (BIO1), isothermality (BIO3), temperature seasonality (BIO4) and mean annual precipitation (BIO12) were downloaded from the web https://www.worldclim.org/. Both range maps and environmental variables were inputted into ModestR and the output file from ModestR is a CSV file that was converted to a RData file.

References

García-Roselló, E., Guisande, C., González-Dacosta, J., Heine, J., Pelayo-Villamil, P., Manjarrés-Hernández, A., Vaamonde, A. & Granado-Lorencio, C. (2013) ModestR: a software tool for managing and analyzing species distribution map databases. Ecography, 36, 1202-1207.

Hijmans, R.J., Cameron, S.E., Parra, J.L., Jones, P.G. and Jarvis, A. (2005) Very high resolution interpolated climate surfaces for global land areas. International Journal of Climatology, 25, 1965-1978.

IUCN (2012) The IUCN Red List of Threatened Species. Version 2012.2. https://www.iucnredlist.org. Downloaded on 17 October 2012.

Pelayo-Villamil, P., Guisande, C., González-Vilas. L., Carvajal-Quintero. J.D., Jiménez-Segura, L.F., García-Roselló, E., Heine, J., González-Dacosta, J., Manjarrés-Hernández, A., Vaamonde, A., Granado-Lorencio, C. (2012) ModestR: Una herramienta infromática para el estudio de los ecosistemas acuáticos de Colombia. Actualidades Biológicas, 34, 225-239.


Niche

Description

This function allows to show a plot overlying the niche of multiple species, so it is possible to determine the niche conditions which favor a higher species richness and, to create boxplots with the range of environmental variables and list of species in an area of the niche selected by the user.

Usage

Niche(data, variables, Level="NULL", Taxon="NULL", cor=TRUE, d.main=0.5,
xlab="Polar coordinate X in pixels",ylab="Polar coordinate Y in pixels",
cex.labS=1.5, font.lab=1, main="", colramp = IDPcolorRamp, cex.main = 2,
font.main=2, nlab.xaxis = 5, nlab.yaxis = 5, minL.axis = 3, las = 1,
border = FALSE, tcl = -0.3, boxplot=TRUE, outline=FALSE, color="NULL",
range = 1.5, width = NULL, varwidth = FALSE, plot = TRUE, 
pars = list(boxwex = 0.8, staplewex = 0.5, outwex = 0.5), cex.boxplot=1.5,
cex.labB=1.5, namesB, family="serif", line=1, file1 = "List of species.csv",
file2 = "Environmental variables.csv", file3 = "Polar coordinates.csv",
na = "NA", dec = ",", row.names = FALSE, fileEncoding = "")

Arguments

data

A CSV file obtained from ModestR (García-Roselló et al., 2013) with data which show the presence of the species and abiotic and/or biotic factors.

variables

Selection of the variables for the estimation of the niche.

Level

Taxonomic level to be selected, i.e., Class, Family, Order, or Genus.

Taxon

Name of the taxon or taxa selected within the level, i.e., name of the Order, Family, etc. Can be a vector, so several taxa.

cor

If TRUE the variables are ordered according to the correlation between them. Therefore, the next variable to another variable is the one that has a greater positive correlation.

d.main

Scatter plot. Vertical distance between upper border of scatter plots and the title line in multiples of title height.

xlab

Scatter plot. Label for x-axis.

ylab

Scatter plot. Label for y-axis.

cex.labS

Scatter plot. Magnification used for text in axis labels relative to the current setting of cex.

font.lab

Scatter plot. The font to be used for x and y labels.

main

Scatter plot. Title of the plot.

colramp

Scatter plot. Color ramp to encode the number of counts within a pixel.

cex.main

Scatter plot. Magnification used for title relative to the current setting of cex.

font.main

Scatter plot. The font to be used for plot main titles.

nlab.xaxis

Scatter plot. Approximate number of labels on x-axes.

nlab.yaxis

Scatter plot. Approximate number of labels on y-axes.

minL.axis

Scatter plot. The minimum length of the abbreviations of factor levels, used to label the axes ticks.

las

Scatter plot. Orientation of labels on axes.

border

Scatter plot. Logical. When TRUE, a border is drawn around the individual colors in the legend.

tcl

Scatter plot. The length of tick marks as a fraction of the height of a line of text. The default value is -0.5; setting tcl = NA sets tck = -0.01 which is S' default.

boxplot

If TRUE (the default) then a boxplot with the range of environmental variables in an area of the niche selected by the user is produced.

outline

Boxplot. If outline is not true, the outliers are not drawn (as points whereas S+ uses lines).

color

Boxplot. If col is non-null it is assumed to contain colors to be used to colour the bodies of the box plots.

range

Boxplot. This determines how far the plot whiskers extend out from the box. If the range is positive, the whiskers extend to the most extreme data point which is no more than range times the interquartile range from the box. A value of zero causes the whiskers to extend to the data extremes.

width

Boxplot. A vector giving the relative widths of the boxes making up the plot.

varwidth

Boxplot. If varwidth is TRUE, the boxes are drawn with widths proportional to the square-roots of the number of observations in the groups.

plot

Boxplot. If TRUE (the default) then a boxplot is produced. If not, the summaries which the boxplots are based on are returned.

pars

Boxplot. A list of (potentially many) more graphical parameters, e.g., boxwex or outpch; these are passed to bxp (if plot is true).

cex.boxplot

Boxplot. Magnification used for axis annotation.

cex.labB

Boxplot. Magnification used for group labels which will be printed under each boxplot.

namesB

Boxplot. Group labels which will be printed under each boxplot. It can be a character vector.

family

The name of a font family for drawing text.

line

mtext. On which margin line, starting at 0 counting outwards.

file1

CSV file. A character string naming the file of the list of species.

file2

CSV file. A character string naming the file with the summary of the environmental variables.

file3

CSV file. A character string naming the file with the summary of the polar coordinates.

na

CSV files. The string to use for missing values in the data.

dec

CSV files. The string to use for decimal points in numeric or complex columns: must be a single character.

row.names

CSV files. Either a logical value indicating whether the row names of x are to be written along with x, or a character vector of row names to be written.

fileEncoding

CSV files. Character string: if non-empty declares the encoding to be used on a file (not a connection) so the character data can be re-encoded as they are written.

Details

The first plot shows the polar coordinates using the environmental variables selected by the user in the CSV file obtained from ModestR (in the example BIO1, BIO3, BIO4 and BIO12 and altitude). In this first plot, a darker color of the square indicates a higher number of species in the cell. In this plot it is necessary to click four times with the mouse to select one or several cells.

The second plot shows a boxplot with the median and range of the environmental variables and/or latitude and longitude, in the cells selected with the mouse.

Value

A list of the species present in the cells selected by the user with the mouse, a summary of the environmental variables and the polar coordinates are saved in three CSV files.

Author(s)

Cástor Guisande González, Universidad de Vigo, Spain.

References

García-Roselló, E., Guisande, C., González-Dacosta, J., Heine, J., Pelayo-Villamil, P., Manjarrés-Hernández, A., Vaamonde, A. & Granado-Lorencio, C. (2013) ModestR: a software tool for managing and analyzing species distribution map databases. Ecography, 36, 1202-1207.

Hijmans, R.J., Cameron, S.E., Parra, J.L., Jones, P.G. and Jarvis, A. (2005)Very high resolution interpolated climate surfaces for global land areas. International Journal of Climatology, 25, 1965-1978.

IUCN (2012) The IUCN Red List of Threatened Species. Version 2012.2. https://www.iucnredlist.org. Downloaded on 17 October 2012.

Examples

data(Carnivores)

Niche(data=Carnivores, variables= c("Altitude", "BIO1", "BIO3",
"BIO4", "BIO12"), Level="Genus", Taxon= c("Leopardus", "Puma", "Panthera"),
cex.boxplot=1.7)

#Remove the data set
rm(Carnivores)

Niche overlap between two taxa

Description

This function shows in a plot the niche overlap between two taxa, at any level of the taxonomy (order, family, genus or species), using the file Polar coordinates.CSV obtained from the function Niche.

Usage

NicheOverlap(data, Level1, Taxon1, Level2=Level1, Taxon2,
colA=hsv(h=0,s=1,v=1,alpha=0.4), colB=hsv(h=0.7,s=1,v=1, alpha=0.4),
xlab="Polar coordinate X in pixel", ylab="Polar coordinate Y in pixels",
cex=1.57, cex.lab=1.5,font.lab=1, main="", cex.main = 2, font.main=2,
family="serif", digits =2, xlegend="topleft", ylegend=NULL, pch=15, bty="n",
text.font=3, cex.legend=1.2, ncol=1, x.intersp=1, y.intersp=1, legend=TRUE)

Arguments

data

The file Polar coodinates.CSV obtained from the function Niche().

Level1

Taxonomic level to be selected, i.e., Class, Order, Family, or Genus, of the first taxon.

Taxon1

Name of the taxon of the first taxonomic level.

Level2

Taxonomic level to be selected, i.e., Class, Order, Family, or Genus, of the second taxon. If missing the default value is Level1.

Taxon2

Name of the taxon of the second taxonomic level.

colA

Color of Taxon1.

colB

Color of Taxon2.

xlab

Label for x-axis.

ylab

Label for y-axis.

cex

Size of the symbols.This argument and the function omi() are useful to adjust the overlap among symbols and to avoid white lines.

cex.lab

Magnification used for text in axis labels relative to the current setting of cex.

font.lab

The font to be used for x and y labels.

main

Title of the plot.

cex.main

Magnification used for title relative to the current setting of cex.

font.main

The font to be used for plot main titles.

family

The name of a font family for drawing text.

digits

Integer indicating the number of decimal places of the overlap values.

xlegend

The x co-ordinates to be used to position the legend.

ylegend

The y co-ordinates to be used to position the legend.

pch

The plotting symbols appearing in the plot and in the legend.

bty

The type of box to be drawn around the legend. The allowed values are "o" and "n" (the default).

text.font

The font used for the legend text, see text.

cex.legend

Character expansion factor relative to current par("cex") of the legend.

ncol

The number of columns in which to set the legend items.

x.intersp

Character interspacing factor for horizontal (x) spacing of the legend.

y.intersp

Character interspacing factor for vertical (y) spacing of the legend.

legend

If TRUE the legend is shown.

Details

The plot shows the niche overlap between two taxa using the file Polar coordinates.CSV obtained from the function Niche(). The overlap is estimated counting the overlapping pixels.

Value

A plot shows the values of niche overlap for both taxa and the overlapping area.

Author(s)

Cástor Guisande González, Universidad de Vigo, Spain.

Examples

## Not run: 

data(Polar.coordinates)

NicheOverlap(Polar.coordinates, Level1="Species", Taxon1="Panthera onca",
Taxon2="Panthera leo")

#Remove the data set
rm(Polar.coordinates)

## End(Not run)

Niche overlap among all species within a taxa

Description

Estimation of the niche overlap among all species within a taxa of a taxonomic level selected by the user (order, family or genus), using the file Polar coordinates.CSV obtained from the function Niche.

Usage

OverlapTaxa(data, Level, digits =2, file1 = "Overlap among taxa.csv",
file2 = "Mean overlap among taxa.csv", na = "NA", dec = ",", row.names = FALSE,
fileEncoding = "")

Arguments

data

The file Polar coodinates.CSV obtained from the function Niche().

Level

Taxonomic level to be selected, i.e., Class, Order, Family, or Genus

digits

Integer indicating the number of decimal places of the overlap values.

file1

CSV file. A character string naming the file with the overllap among species.

file2

CSV file. A character string naming the file with mean and standard deviation of the overlap for each taxonomic level selected by the user.

na

CSV files. The string to use for missing values in the data.

dec

CSV files. The string to use for decimal points in numeric or complex columns: must be a single character.

row.names

CSV files. Either a logical value indicating whether the row names of x are to be written along with x, or a character vector of row names to be written.

fileEncoding

CSV files. Character string: if non-empty declares the encoding to be used on a file (not a connection) so the character data can be re-encoded as they are written.

Details

In the first CSV file this function estimates the niche overlap, using the file Polar coordinates.CSV obtained from the function Niche(), among all species within the taxonomic level selected by the user. In the second CSV file the function estimates the mean overlap within the taxonomic level selected by the user. If there are many species, e.g. over 5000, the process can take several hours.

Value

Two CSV files with the overlap among species and the mean overlap among the species for the taxonomic level selected by the user.

Author(s)

Cástor Guisande González, Universidad de Vigo, Spain.

Examples

## Not run: 

data(Polar.coordinates)

OverlapTaxa(data=Polar.coordinates, Level="Genus")

#Remove the data set
rm(Polar.coordinates)


## End(Not run)

Polar cooordinates obtained from the function Niche

Description

Polar cooordinates.CSV file obtained from the function Niche using presence data of terrestrial carnivores of the family Felidae and mean of environmental variables in cells of 1 degree x 1 degree around the world.

Usage

data(Polar.coordinates)

Format

A matrix with the taxonomy, polar coordinates and mean values of the environemntal variables for each polar coordinate.

Source

The range maps of the species were obtained from the International Union for Conservation of Nature (IUCN) at the web page https://www.iucn.org/. The data of the mean annual temperature (BIO1), isothermality (BIO3), temperature seasonality (BIO4) and mean annual precipitation (BIO12) were downloaded from the web https://www.worldclim.org/. Both range maps and environmental variables were inputted into ModestR and the output file was used in the function Niche() and the file Polar coordinates.CSV obtained was converted to a RData file.

References

García-Roselló, E., Guisande, C., González-Dacosta, J., Heine, J., Pelayo-Villamil, P., Manjarrés-Hernández, A., Vaamonde, A. & Granado-Lorencio, C. (2013) ModestR: a software tool for managing and analyzing species distribution map databases. Ecography, 36, 1202-1207.

Hijmans, R.J., Cameron, S.E., Parra, J.L., Jones, P.G. and Jarvis, A. (2005) Very high resolution interpolated climate surfaces for global land areas. International Journal of Climatology, 25, 1965-1978.

IUCN (2012) The IUCN Red List of Threatened Species. Version 2012.2. https://www.iucnredlist.org. Downloaded on 17 October 2012.

Pelayo-Villamil, P., Guisande, C., González-Vilas. L., Carvajal-Quintero. J.D., Jiménez-Segura, L.F., García-Roselló, E., Heine, J., González-Dacosta, J., Manjarrés-Hernández, A., Vaamonde, A., Granado-Lorencio, C. (2012) ModestR: Una herramienta infromática para el estudio de los ecosistemas acuáticos de Colombia. Actualidades Biológicas, 34, 225-239.