The 'get_ausplots' function in the 'ausplotsR' package extracts and compiles AusPlots data. Up to 8 different types of data can be obtained by setting the corresponding function arguments to TRUE/FALSE (i.e. 'site_info', 'structural_summaries', 'veg.vouchers', 'veg.PI', 'basal.wedge', 'soil_subsites', 'soil_bulk_density', and 'soil_character'). AusPlots data are extracted in to a list containing data frames, one data frame for data type requested. Other functions in the 'ausplotsR' can be used to pre-process the AusPlots raw data, preparing it for exploration, visualisation, and/or analysis (i.e. 'species_table', 'fractional_cover', 'growth_form_table', 'single_cover_value', and 'basal_area' functions). Each of these pre-processing functions returns data stored in a data frame.
...
Boxes with grey background contain code snippets, and boxes with white background containt code (text) outputs.
Preparation
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
file.path = "C:/Users/uqbblanc/Documents/TERN/CWDir_TutBasicAusPlots"
today = toString(Sys.Date())
today
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## [1] "2019-06-25"
|
.
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
date.s = paste(substr(today,start=3,stop=4),substr(today,start=6,stop=7),
substr(today,start=9,stop=10),sep="")
date.s
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## [1] "190625"
|
.
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
library(ausplotsR)
AP.data.l = get_ausplots( my.Plot_IDs=c("SATFLB0004", "QDAMGD0022", "NTASTU0002"),
structural_summaries=TRUE, basal.wedge=TRUE)
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## User-supplied Plot_IDs locatedlocated.
|
.
.
.
Example 1: Save an AusPlots retrived Data Frame, using 'write.table'
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
summary(AP.data.l$veg.basal)
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## site_location_name site_location_visit_id site_location_id
## Length:95 Min. :53705 Min. :60122
## Class :character 1st Qu.:58429 1st Qu.:60122
## Mode :character Median :58429 Median :61138
## Mean :57395 Mean :60635
## 3rd Qu.:58658 3rd Qu.:61138
## Max. :58658 Max. :61138
## point_id herbarium_determination veg_barcode
## Length:95 Length:95 Length:95
## Class :character Class :character Class :character
## Mode :character Mode :character Mode :character
##
##
##
## hits basal_area_factor basal_area site_unique
## Min. : 1.000 Min. :-1.0000 Min. :-1.000 Length:95
## 1st Qu.: 2.000 1st Qu.: 0.1000 1st Qu.: 0.300 Class :character
## Median : 5.000 Median : 0.1000 Median : 0.900 Mode :character
## Mean : 5.979 Mean : 0.2495 Mean : 1.885
## 3rd Qu.: 8.500 3rd Qu.: 0.5000 3rd Qu.: 2.875
## Max. :20.000 Max. : 2.0000 Max. :14.000
|
.
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
file.name = paste("AP_3Sites_BasalWedge",date.s,sep="_")
file.name
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## [1] "AP_3Sites_BasalWedge_190625"
|
.
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
file.name = paste(file.name,"txt",sep=".")
file.name
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## [1] "AP_3Sites_BasalWedge_190625.txt"
|
.
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
write.table(AP.data.l$veg.basal, paste(file.path, file.name, sep="/"), sep="\t")
|
.
.
.
Example 2: Save an AusPlots derived Data Frame (generated for pre-processing), using 'write.csv'
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
AP.3Sites.BAperPlot = basal_area(AP.data.l$veg.basal, by.spp=FALSE, by.hits=FALSE)
summary(AP.3Sites.BAperPlot)
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## site_unique basal_area_m2_ha
## Length:3 Min. :3.994
## Class :character 1st Qu.:5.947
## Mode :character Median :7.900
## Mean :6.631
## 3rd Qu.:7.950
## Max. :8.000
|
.
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
file.name = paste("AP_3Sites_BasalArea",date.s,sep="_")
file.name
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## [1] "AP_3Sites_BasalArea_190625"
|
.
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
file.name = paste(file.name,"csv",sep=".")
file.name
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## [1] "AP_3Sites_BasalArea_190625.csv"
|
.
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
write.csv(AP.3Sites.BAperPlot, paste(file.path, file.name, sep="/"))
|
.
.
.
Example 3: Save an AusPlots retrived list, using 'save'
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
names(AP.data.l)
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## [1] "site.info" "struct.summ" "veg.basal" "veg.vouch" "veg.PI"
## [6] "citation
|
.
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
file.name = paste("AP_3Sites_SiteVegInfo",date.s,sep="_")
file.name
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## [1] "AP_3Sites_SiteVegInfo_190625"
|
.
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
file.name = paste(file.name,"RData",sep=".")
file.name
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## [1] "AP_3Sites_SiteVegInfo_190625.RData"
|
.
.
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
save(AP.data.l, file=paste(file.path, file.name, sep="/"))
|
.
.
.