CreateDatasets <- function(){
## The ElevationData dataset contains site-level data - latitude and longitude,
## site elevation, site name, and whether the site is a lake or a river
ElevationData <<- read.csv(system.file("extdata", "ElevationData.csv", package = "BeaverForaging"), stringsAsFactors = F)
## The PlotData dataset contains plot-level data - cross-valley slope and the
## amount of light penetrating the canopy
PlotData <- read.csv(system.file("extdata", "PlotData.csv", package = "BeaverForaging"), stringsAsFactors = F)
PlotData$PlotCode <- CodePlots(PlotData)
PlotData$LightDots <- as.numeric(PlotData$LightDots)
PlotData$CanopyCover <- 100 - (PlotData$LightDots / (96/100))
PlotData <<- PlotData
## The LightData dataset is used for canopy cover analysis
LightData <- PlotData %>%
mutate(CanopyProp = CanopyCover/100) %>%
left_join(ElevationData) ## Join to identify which sites are lakes/streams
LightData <<- filter(LightData, !is.na(LightData$CanopyProp)) ## NA values are technician error
## The InventoryData dataset contains data on the forest inventory performed,
## with a large amount of information about over 10,000 stems
InventoryData <- read.csv(system.file("extdata", "InventoryData.csv", package = "BeaverForaging"), stringsAsFactors = F)
InventoryData$PlotCode <- CodePlots(InventoryData)
InventoryData$Phyla <- PhylaList(InventoryData)
InventoryData$CommonNames <- SpeciesNames(InventoryData)
InventoryData$DBHAvg <- DiameterAverage(InventoryData)
InventoryData$Beaver <- BeaverStatus(InventoryData)
InventoryData <<- InventoryData
## This dataset removes all seedlings from the dataset, so analyses may be
## performed on stems
NonSeedlingData <<- InventoryData %>%
filter(DBHClass != "0-1" & HeightClass != "0-1")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.