The 'get_ausplots' function extracts and compiles AusPlots data allowing substantial flexibility in the selection of the required data. Up to 8 different types of data can be retrieved into distinct data frames (i.e. data on sampling sites, vegetation structure, vegetation point intercept, vegetation vouchers, vegetation basal wedge, soil characterization, soil bulk density, and soil & soil metagenomics samples). In addition, data can be filtered for particular sets of plots and/or genus/species, as well as geographically using a rectangular bounding box.
...
However, in some situations we are only interested in a subset of the data retrieved by 'get_ausplots'. To subset ausplot data we use the variables in the retrieved data frames corresponding to the concept by we would like to filter the data. In some occasions we would sub-setting a single data frame (i.e. type of variables) is all what we need. The retrieved data by the function ‘get_ausplots’ can be manipulated as any other R data. However, the ‘deep’ structure of the data (a list of multiple data frames) and interrelation of the data frames (via a common a common link variable) can make manipulating the data a bit more daunting (see below).
Variables in the 'site.info' data frame contain information that affect all other data frames; so typically after sub-setting the contents of the variable of interests in the 'site.info' data frame, we will also subset the remaining datasets using one of the common variables among all data frames. Common variables among datasets include 'site_location_name', 'site_location_visit_id', and 'site_unique'. Commonly 'site_unique' is the best option to ‘connect’ ausplots data frames, as it is the most specific variable representing a single visit to a particular site.
...
Multiple examples includng various types of sub-settng are presented below. Exaples cover sub-setting a single data frame and all data frames, as well as not requiring variable class transformation and requiring it). All examples would start by loading the 'ausplotsR' library and extracting AusPlots data using the 'get_ausplots' function. In the examples we use the `AP.data' list of data frames that contains information for all the currently available AusPlots sites. This list was previously created in the 'Obtaining AusPlots data: 'get_ausplots' function' Step-by-Step Guide (we use the list created in Example 4).
Boxes with grey background contain code snippets, and boxes with white background containt code (text) outputs.
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
class(AP.data$site.info$site_slope)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
slope.AP.data = AP.data
dim(slope.AP.data$site.info)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
slope.AP.data$site.info = slope.AP.data$site.info[slope.AP.data$site.info$site_slope.n >= 20,]
dim(slope.AP.data$site.info)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
class(AP.data$veg.PI$transect)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
summary(AP.data$veg.PI$transect)
|
v.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## E1-W1 E2-W2 E3-W3 E4-W4 E5-W5 N1-S1 N2-S2 N3-S3 N4-S4 N5-S5 S1-N1 S2-N2
## 17360 53886 18164 54046 18900 24573 44070 26962 44845 27579 49639 29566
## S3-N3 S4-N4 S5-N5 W1-E1 W2-E2 W2-S2 W3-E3 W4-E4 W5-E5
## 46476 28582 46296 55976 19447 102 55135 18983 53877
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
E1W1Tr.AP.data = AP.data
dim(E1W1Tr.AP.data$veg.PI)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
E1W1Tr.AP.data$veg.PI = E1W1Tr.AP.data$veg.PI[E1W1Tr.AP.data$veg.PI$transect == "E1-W1",]
levels(E1W1Tr.AP.data$veg.PI$transect)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
class(AP.data$veg.PI$growth_form)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
TreePalm.AP.data = AP.data
dim(TreePalm.AP.data$veg.PI)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
TreePalm.AP.data$veg.PI = TreePalm.AP.data$veg.PI[TreePalm.AP.data$veg.PI$growth_form.f == "Tree/Palm",]
levels(TreePalm.AP.data$veg.PI$growth_form.f)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
class(AP.data$site.info$site_slope)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
slope.AP.data = AP.data
dim(slope.AP.data$site.info)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
slope.AP.data$site.info = slope.AP.data$site.info[slope.AP.data$site.info$site_slope.n >= 20,]
dim(slope.AP.data$site.info)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
dim(slope.AP.data$veg.PI)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
slope.AP.data$veg.PI = slope.AP.data$veg.PI[slope.AP.data$veg.PI$site_unique %in% slope.AP.data$site.info$site_unique, ]
dim(slope.AP.data$veg.PI)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
dim(slope.AP.data$veg.basal)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
slope.AP.data$veg.basal = slope.AP.data$veg.basal[slope.AP.data$veg.basal$site_unique %in% slope.AP.data$site.info$site_unique, ]
dim(slope.AP.data$veg.basal)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
class(AP.data$site.info$site_aspect)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
aspect.AP.data = AP.data
dim(aspect.AP.data$site.info)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
aspect.AP.data$site.info = aspect.AP.data$site.info[(aspect.AP.data$site.info$site_aspect.n > 135 &
aspect.AP.data$site.info$site_aspect.n <= 225),]
dim(aspect.AP.data$site.info)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
dim(aspect.AP.data$veg.PI)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
aspect.AP.data$veg.PI = aspect.AP.data$veg.PI[aspect.AP.data$veg.PI$site_unique %in% aspect.AP.data$site.info$site_unique, ]
dim(aspect.AP.data$veg.PI)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
dim(aspect.AP.data$veg.basal)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
aspect.AP.data$veg.basal = aspect.AP.data$veg.basal[aspect.AP.data$veg.basal$site_unique %in% aspect.AP.data$site.info$site_unique, ]
dim(aspect.AP.data$veg.basal)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
class(AP.data$site.info$state)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
QLD.AP.data = AP.data
dim(QLD.AP.data$site.info)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
QLD.AP.data$site.info = QLD.AP.data$site.info[QLD.AP.data$site.info$state.f == "QLD",]
levels(QLD.AP.data$site.info$state.f)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
dim(QLD.AP.data$veg.PI)
|
.
Div |
---|
style | background-color: white; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
## [1] 734464 14
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
QLD.AP.data$veg.PI = QLD.AP.data$veg.PI[QLD.AP.data$veg.PI$site_unique %in% QLD.AP.data$site.info$site_unique, ]
dim(QLD.AP.data$veg.PI)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
dim(QLD.AP.data$veg.basal)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
QLD.AP.data$veg.basal = QLD.AP.data$veg.basal[QLD.AP.data$veg.basal$site_unique %in% QLD.AP.data$site.info$site_unique, ]
dim(QLD.AP.data$veg.basal)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
class(AP.data$site.info$bioregion_name)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
EGCBioregs.AP.data = AP.data
dim(EGCBioregs.AP.data$site.info)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
EastCarpGulf.Bioreg = c("CYP", "GUP")
EGCBioregs.AP.data$site.info = EGCBioregs.AP.data$site.info[EGCBioregs.AP.data$site.info$bioregion_name.f %in% EastCarpGulf.Bioreg,]
levels(EGCBioregs.AP.data$site.info$bioregion_name.f)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
dim(EGCBioregs.AP.data$veg.PI)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
EGCBioregs.AP.data$veg.PI = EGCBioregs.AP.data$veg.PI[EGCBioregs.AP.data$veg.PI$site_unique %in% EGCBioregs.AP.data$site.info$site_unique, ]
dim(EGCBioregs.AP.data$veg.PI)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
dim(EGCBioregs.AP.data$veg.basal)
|
...
Div |
---|
style | background-color: #F8F9F9; border: 1px solid #666; font-size: 12px; padding: 0.5rem 0.5rem; |
---|
|
EGCBioregs.AP.data$veg.basal = EGCBioregs.AP.data$veg.basal[EGCBioregs.AP.data$veg.basal$site_unique %in% EGCBioregs.AP.data$site.info$site_unique, ]
dim(EGCBioregs.AP.data$veg.basal)
|
...