Combine_AIM_LMF_Species: Combine_AIM_LMF_Species

Description Usage Arguments Author(s) Examples

View source: R/Combine_AIM_LMF_Species.R

Description

Combines species indicators for TerrADat and LMF datasets. Returns a dataframe.

Usage

1
Combine_AIM_LMF_Species(TerrADat_Path, Internal)

Arguments

TerrADat_Path

Path to TerrADat geodatabase. Set to NULL if on Bureau of Land Management network/vpn.

Internal

logical. TRUE if within BLM network/on vpn. FALSE if accessing TerrADat via external geodatabase.

Author(s)

Rachel Burke, ecologist/analyst @ Jornada

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# If accessing TerrADat via external geodatabase:
Species_Indicator <- Combine_AIM_LMF_Species(TerrADat_Path = 
                     "TerrADat_Path"~/gdbs/TerrADat.gdb"", Internal = FALSE)
          
# If accessing TerrADat via BLM network:
Species_Indicator <- Combine_AIM_LMF_Species(TerrADat_Path = NULL, Internal = TRUE)
          
## The function is currently defined as
function (TerrADat_Path, Internal) 
{
    if (!Internal) {
        TerrADatSpecies <- sf::st_read(dsn = TerrADat_Path, layer = "TerrADatSpeciesIndicators")
        LMFSpecies <- sf::st_read(dsn = TerrADat_Path, layer = "LMFSpeciesIndicators")
        TerrADatSpecies <- as.data.frame(TerrADatSpecies)
        TerrADatSpecies <- dplyr::select(TerrADatSpecies, -Shape)
        LMFSpecies <- as.data.frame(LMFSpecies)
        LMFSpecies <- dplyr::select(LMFSpecies, -Shape)
    }
    if (Internal) {
        TerrADatSpecies <- TerrADatSpecies
        LMFSpecies <- LMFSpecies
        SpeciesList <- SpeciesList
    }
    LMFSpecies[setdiff(names(TerrADatSpecies), names(LMFSpecies))] <- NA
    TerrADatSpecies[setdiff(names(LMFSpecies), names(TerrADatSpecies))] <- NA
    output <- rbind(TerrADatSpecies, LMFSpecies)
    return(output)
  }

R-Burke/SiteSummaryTool documentation built on Oct. 15, 2020, 8:21 p.m.