Species-Level data: 'species_table' function
The 'species'_table function in the 'ausplotsR' is used to generate a species occurrence matrix from AusPlots raw data. The species occurence matrix can be then used in multiple applications that require species-level data. For example, it can be used to investigate patterns of presence/absence and/or abundance (note that vegetation 'cover' is used as a surrogate for vegetation 'abundace'), compute indices of species diversity, or elaborate rank-abundance plots.
The 'species_table' function takes a data frame of individual raw point intercept hits (i.e. a veg.PI data frame) generated using the 'get_ausplots function', and returns a ‘species against sites’ matrix. Four metrics can be selected to score species occurrence:
- Presence/Absence: Set by the argument 'm_kind = "PA"'.
- Percent Cover: Based on total frequency of hits. This is the most commonly used metric. Set by the argument 'm_kind = "percent_cover"'.
- Frequency: Based on proportional frequencies of presence on the 10 individual transects within a plot. Set by the argument 'm_kind = "freq"'. It can be a measure of importance for low cover species.
- IVI: A combination of cover and frequency. Set by the argument 'm_kind = "IVI"'.
If Percent Cover or IVI are used two types of cover type can be selected:
- Projected Foliage Cover (PFC):Hits scored as ‘in canopy sky’ are removed. Set by the argument 'cover_type = "PFC"'.
- Opaque Canopy Cover (OCC): Hits scored as ‘in canopy sky’ are retained. Set by the argument 'cover_type = "OCC"'
EXAMPLES
Examples of the different arguments combinations in the 'species_table' function are presented below. Species occurrence matrices are computed for the full set of vegetation point intersect data currently available at AusPlots. The list of data frames containing information for all currently available AusPlots sites (i.e. the 'AP.data' list) was previously created using the `get_ausplots` function (see the 'Obtaining AusPlots data: 'get_ausplots' function' Step-by-Step Guide; we use the list created in Example 4). The class and dimensions of the returned data frame are the same in all examples, so they are only displayed for the first example (the corresponding code is commented out in the other examples). The resulting species occurrence data frames can be enriched with additional information (see the 'Manipulating AusPlots data II: Merging data frames' Step-by-Step Guide).
Boxes with grey background contain code snippets, and boxes with white background containt code (text) outputs.
Example 1. Scoring metric; Presence/Absence ('m_kind = "PA")
.
# ===========================================================================
# SPECIES-LEVEL DATA: 'species_table' function and species occurence matrices
# ===========================================================================
# Scoring metric: Presence/Absence
# ================================
AP.data.SppbySites.PA = species_table(AP.data$veg.PI, m_kind="PA")
class(AP.data.SppbySites.PA)
.
## [1] "data.frame"
.
.
dim(AP.data.SppbySites.PA) # Number of rows and columns in the matrix: Sites x Species
.
## [1] 653 3665
.
.
AP.data.SppbySites.PA[1:5, 1:5]
.
## Abutilon.fraseri Abutilon.halophilum Abutilon.hannii
## NSABBS0005-58582 0 0 0
## NSABBS0006-58557 0 0 0
## NSABHC0001-53596 0 0 0
## NSABHC0002-53597 0 0 0
## NSABHC0003-53598 0 0 0
## Abutilon.hannii.subsp..prostrate..p.k.latz.427.
## NSABBS0005-58582 0
## NSABBS0006-58557 0
## NSABHC0001-53596 0
## NSABHC0002-53597 0
## NSABHC0003-53598 0
## Abutilon.leucopetalum
## NSABBS0005-58582 0
## NSABBS0006-58557 0
## NSABHC0001-53596 0
## NSABHC0002-53597 0
## NSABHC0003-53598 0
.
.
summary(AP.data.SppbySites.PA[,1:3])
.
## Abutilon.fraseri Abutilon.halophilum Abutilon.hannii
## Min. :0.00000 Min. :0.000000 Min. :0.000000
## 1st Qu.:0.00000 1st Qu.:0.000000 1st Qu.:0.000000
## Median :0.00000 Median :0.000000 Median :0.000000
## Mean :0.01072 Mean :0.007657 Mean :0.001531
## 3rd Qu.:0.00000 3rd Qu.:0.000000 3rd Qu.:0.000000
## Max. :1.00000 Max. :1.000000 Max. :1.000000
.
.
.
Example 2A. Scoring metric; Percent Cover (m_kind = "percent_cover"), Cover Type: Prejected Foliage Cover (cover_type="PFC")
.
# Scoring metric: Percent Cover
# =============================
# Cover Type: Projected foliage cover (PFC)
# -----------------------------------------
# Hits scoered as 'in canopy sky' are removed
AP.data.SppbySites.PcC.PFC = species_table(AP.data$veg.PI, m_kind="percent_cover", cover_type="PFC")
#class(AP.data.SppbySites.PcC.PFC)
#dim(AP.data.SppbySites.PcC.PFC) # Number of rows and columns in the matrix: Sites x Species
#AP.data.SppbySites.PcC.PFC[1:5, 1:5]
summary(AP.data.SppbySites.PcC.PFC[,1:3])
.
## Abutilon.fraseri Abutilon.halophilum Abutilon.hannii
## Min. :0.000000 Min. :0.000000 Min. :0.0000000
## 1st Qu.:0.000000 1st Qu.:0.000000 1st Qu.:0.0000000
## Median :0.000000 Median :0.000000 Median :0.0000000
## Mean :0.001516 Mean :0.005307 Mean :0.0003033
## 3rd Qu.:0.000000 3rd Qu.:0.000000 3rd Qu.:0.0000000
## Max. :0.297030 Max. :1.980198 Max. :0.1980198
.
.
.
Example 2B. Scoring metric; Percent Cover (m_kind = "percent_cover"), Cover Type: Opaque Canopy Cover (cover_type="OCC")
.
# Cover Type: Opaque Canopy Cover (OCC)
# -------------------------------------
# Hits scoered as 'in canopy sky' are retained
AP.data.SppbySites.PcC.OCC = species_table(AP.data$veg.PI, m_kind="percent_cover", cover_type="OCC")
#class(AP.data.SppbySites.PcC.OCC)
#dim(AP.data.SppbySites.PcC.OCC) # Number of rows and columns in the matrix: Sites x Species
#AP.data.SppbySites.PcC.OCC[1:5, 1:5]
summary(AP.data.SppbySites.PcC.OCC[,1:3])
.
## Abutilon.fraseri Abutilon.halophilum Abutilon.hannii
## Min. :0.000000 Min. :0.000000 Min. :0.0000000
## 1st Qu.:0.000000 1st Qu.:0.000000 1st Qu.:0.0000000
## Median :0.000000 Median :0.000000 Median :0.0000000
## Mean :0.001516 Mean :0.005307 Mean :0.0003033
## 3rd Qu.:0.000000 3rd Qu.:0.000000 3rd Qu.:0.0000000
## Max. :0.297030 Max. :1.980198 Max. :0.1980198
.
.
.
Example 3. Scoring metric; Frequency ('m_kind = "freq")
.
# Scoring metric: Frequency
# =========================
AP.data.SppbySites.Freq = species_table(AP.data$veg.PI, m_kind="freq")
#class(AP.data.SppbySites.Freq)
#dim(AP.data.SppbySites.Freq) # Number of rows and columns in the matrix: Sites x Species
#AP.data.SppbySites.Freq[1:5, 1:5]
summary(AP.data.SppbySites.Freq[,1:3])
.
## Abutilon.fraseri Abutilon.halophilum Abutilon.hannii
## Min. :0.000000 Min. :0.00000 Min. :0.0000000
## 1st Qu.:0.000000 1st Qu.:0.00000 1st Qu.:0.0000000
## Median :0.000000 Median :0.00000 Median :0.0000000
## Mean :0.001378 Mean :0.00245 Mean :0.0003063
## 3rd Qu.:0.000000 3rd Qu.:0.00000 3rd Qu.:0.0000000
## Max. :0.200000 Max. :0.80000 Max. :0.2000000
.
.
.
Example 4A. Scoring metric; IVI (m_kind = "IVI"), Cover Type: Prejected Foliage Cover (cover_type="PFC")
.
# Scoring metric: IVI
# ===================
# Cover Type: Projected foliage cover (PFC)
# -----------------------------------------
# Hits scoered as 'in canopy sky' are removed
AP.data.SppbySites.IVI.PFC = species_table(AP.data$veg.PI, m_kind="IVI", cover_type="PFC")
#class(AP.data.SppbySites.IVI.PFC)
#dim(AP.data.SppbySites.IVI.PFC) # Number of rows and columns in the matrix: Sites x Species
#AP.data.SppbySites.IVI.PFC[1:5, 1:5]
summary(AP.data.SppbySites.IVI.PFC[,1:3])
.
## Abutilon.fraseri Abutilon.halophilum Abutilon.hannii
## Min. :0.000000 Min. :0.00000 Min. :0.0000000
## 1st Qu.:0.000000 1st Qu.:0.00000 1st Qu.:0.0000000
## Median :0.000000 Median :0.00000 Median :0.0000000
## Mean :0.001378 Mean :0.00245 Mean :0.0003063
## 3rd Qu.:0.000000 3rd Qu.:0.00000 3rd Qu.:0.0000000
## Max. :0.200000 Max. :0.80000 Max. :0.2000000
.
.
.
Example 4B. Scoring metric; IVI (m_kind = "IVI"), Cover Type: Opaque Canopy Cover (cover_type="OCC")
.
# Cover Type: Opaque Canopy Cover (OCC)
# -------------------------------------
# Hits scoered as 'in canopy sky' are retained
AP.data.SppbySites.IVI.OCC = species_table(AP.data$veg.PI, m_kind="IVI", cover_type="OCC")
#class(AP.data.SppbySites.IVI.OCC)
#dim(AP.data.SppbySites.IVI.OCC) # Number of rows and columns in the matrix: Sites x Species
#AP.data.SppbySites.IVI.OCC[1:5, 1:5]
summary(AP.data.SppbySites.IVI.OCC[,1:3])
.
## Abutilon.fraseri Abutilon.halophilum Abutilon.hannii
## Min. :0.000000 Min. :0.00000 Min. :0.0000000
## 1st Qu.:0.000000 1st Qu.:0.00000 1st Qu.:0.0000000
## Median :0.000000 Median :0.00000 Median :0.0000000
## Mean :0.001378 Mean :0.00245 Mean :0.0003063
## 3rd Qu.:0.000000 3rd Qu.:0.00000 3rd Qu.:0.0000000
## Max. :0.200000 Max. :0.80000 Max. :0.2000000
.
.
.