Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


The 'basal_area' function in the 'ausplotsR' package calculates the Basal Area or Mean Number of Basal Wedge Hits of plots using the raw basal wedge data returned by the 'get_ausplots' function also in the 'ausplotsR' package.


The basal_area function has the following arguments:

  • 'veg.basal': Name of the data frame containing the Raw Basal Wedge Data generated by the 'get_ausplots' function in the 'ausplotsR' package.
  • 'by.spp': Whether Basal Wedge values are computed by Plot or Individual Species. This argument can take two values:
    • 'FALSE': The function returns combined values per plot. This is the default value for the argument.
    • 'TRUE': Returns values for individual species
  • 'by.hits': Whether the Basal Wedge values are computed as Basal Area or Mean Number of Individual Basal Wedge Hits. This argument can take two values:
    • 'FALSE': The function returns the Basal Area (in m2/ha). This is the default value for the argument.
    • 'TRUE': Returns the Mean Number of Individual Basal Wedge Hits.


This function returns a data frame with two columns. In this data frame rows correspond to representing Plots (or species by plots), the first column contains the unique sites names and the second column contains the Basal Area or Hit Scores depending on the value assigned to the 'by.hits' argument.





EXAMPLES

Examples of the use of the 'basal_area' function to compute the Basal Area or Mean Number of Basal Wedge Hits of individual plots from raw basal wedge data (as returned by the 'get_ausplots' function) are presented below. Basal areas (or mean number of /wedge hits) are computed for the full set of basal wedge 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 Guidewe use the list created in Example 4). The resulting Basal Areas or Mean Number of Wedge Hits data frames can be enriched with additional information as seen  as seen in the 'Manipulating AusPlots data II: Merging data frames' Step-by-Step Guide. The examples below cover all possible combinations of argument values in the 'basal_area 'function.

Boxes with grey background contain code snippets, and boxes with white background containt code (text) outputs.




Example 1: Basal Area (m2/ha) per Plot (the default argument values)


Div
stylebackground-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
# ======================================
# Basal Area data: 'basal_area' function
# ======================================
# The default arguments are: 'by.spp=FALSE' and 'by.hits=FALSE'

# Basal Area (m2/ha) per Plot (the default argument values)
# =========================================================
AP.data.BAperPlot = basal_area(AP.data$veg.basal)
class(AP.data.BAperPlot)


Div
stylebackground-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
## [1] "data.frame"



Div
stylebackground-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
dim(AP.data.BAperPlot)


Div
stylebackground-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
## [1] 354   2



Div
stylebackground-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
head(AP.data.BAperPlot)


Div
stylebackground-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
##        site_unique basal_area_m2_ha
## 1 NSABBS0005-58582        26.805556
## 2 NSABBS0006-58557        22.577778
## 3 NSABHC0028-58027        11.588889
## 4 NSABHC0029-58028        26.905556
## 5 NSACHC0002-58558         4.616667
## 6 NSACHC0003-58575         9.437500



Div
stylebackground-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
summary(AP.data.BAperPlot)


Div
stylebackground-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
##  site_unique        basal_area_m2_ha
##  Length:354         Min.   : 0.050  
##  Class :character   1st Qu.: 2.282  
##  Mode  :character   Median : 4.811  
##                     Mean   : 7.601  
##                     3rd Qu.:10.189  
##                     Max.   :43.094




Example 2: Basal Area (m2/ha) per Individual Species


Div
stylebackground-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
# Basal Area (m2/ha)  per Individual Species
# ==========================================
AP.data.BAperSpp = basal_area(AP.data$veg.basal, by.spp=TRUE)
#class(AP.data.BAperSpp)
#dim(AP.data.BAperSpp)
head(AP.data.BAperSpp)


Div
stylebackground-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
##        site_unique herbarium_determination basal_area_m2_ha
## 1 WAAGES0003-58025       Acacia acuminata          0.350000
## 2 NSAMDD0027-57087           Acacia aneura         6.416667
## 3 NSAMUL0004-58560           Acacia aneura         5.843750
## 4 NTABRT0001-53616           Acacia aneura         0.800000
## 5 NTABRT0002-53617           Acacia aneura         0.612500
## 6 NTAFIN0004-58010           Acacia aneura         1.422222



Div
stylebackground-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
summary(AP.data.BAperSpp)


Div
stylebackground-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
##  site_unique        herbarium_determination basal_area_m2_ha 
##  Length:1613        Length:1613             Min.   :-0.4000  
##  Class :character   Class :character        1st Qu.: 0.3000  
##  Mode  :character   Mode  :character        Median : 0.7333  
##                                             Mean   : 1.9947  
##                                             3rd Qu.: 2.0278  
##                                             Max.   :40.2500




Example 3: Mean Number of Basal Wedge Hits per Plot


Div
stylebackground-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
# Mean Number of Basal Wedge Hits per Plot
# ========================================
AP.data.BWHperPlot = basal_area(AP.data$veg.basal, by.hits=TRUE)
#class(AP.data.BWHperPlot)
#dim(AP.data.BWHperPlot)
head(AP.data.BWHperPlot)


Div
stylebackground-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
##        site_unique mean_hits
## 1 NSABBS0005-58582  24.77778
## 2 NSABBS0006-58557  25.11111
## 3 NSABHC0028-58027  20.44444
## 4 NSABHC0029-58028  16.88889
## 5 NSACHC0002-58558  10.11111
## 6 NSACHC0003-58575   8.87500



Div
stylebackground-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
summary(AP.data.BWHperPlot)


Div
stylebackground-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
##  site_unique          mean_hits    
##  Length:354         Min.   : 1.00  
##  Class :character   1st Qu.:11.44  
##  Mode  :character   Median :16.83  
##                     Mean   :18.01  
##                     3rd Qu.:22.52  
##                     Max.   :62.78




Example 4: Mean Number of Basal Wedge Hits per Individual Species


Div
stylebackground-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
# Mean Number of Basal Wedge Hits per Individual Species
# ======================================================
AP.data.BWHperSpp = basal_area(AP.data$veg.basal, by.spp=TRUE, by.hits=TRUE)
#class(AP.data.BWHperSpp)
#dim(AP.data.BWHperSpp)
head(AP.data.BWHperSpp)


Div
stylebackground-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
##        site_unique herbarium_determination mean_hits
## 1 WAAGES0003-58025       Acacia acuminata   3.500000
## 2 NSAMDD0027-57087           Acacia aneura  9.888889
## 3 NSAMUL0004-58560           Acacia aneura 10.875000
## 4 NTABRT0001-53616           Acacia aneura  8.000000
## 5 NTABRT0002-53617           Acacia aneura  6.125000
## 6 NTAFIN0004-58010           Acacia aneura 14.222222



Div
stylebackground-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
summary(AP.data.BWHperSpp)


Div
stylebackground-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem;
##  site_unique        herbarium_determination   mean_hits      
##  Length:1613        Length:1613             Min.   : 0.6667  
##  Class :character   Class :character        1st Qu.: 2.0000  
##  Mode  :character   Mode  :character        Median : 4.2500  
##                                             Mean   : 5.3265  
##                                             3rd Qu.: 7.7500  
##                                             Max.   :38.7778