Package 'PSPclean'

Title: Sources and standardizes permanent sample plot data
Description: Converts all data into two keyed tables. One is for tree measurements, and the other is for plot data. Some arguments exist for handling disturbance agents.
Authors: Ian M S Eddy [aut, cre], Alex M Chubaty [ctb]
Maintainer: Ian M S Eddy <[email protected]>
License: GPL-3
Version: 0.1.5.9002
Built: 2024-10-31 22:16:19 UTC
Source: https://github.com/ianmseddy/PSPclean

Help Index


standardize and treat the Alberta PSP data

Description

standardize and treat the Alberta PSP data

Usage

dataPurification_ABPSP(
  treeMeasure,
  plotMeasure,
  tree,
  plot,
  codesToExclude = 3,
  excludeAllObs = TRUE,
  areaDiffThresh = 0.95
)

Arguments

treeMeasure

the tree measurement csv

plotMeasure

the plot_measurement csv

tree

the tree csv

plot

the plot csv

codesToExclude

damage agent codes used to filter tree data - see GOA PSP Manual. Measurements with these codes will be removed

excludeAllObs

if removing observations of individual trees due to damage codes,

areaDiffThresh

the threshold of plot size discrepancy to allow below which plots will be given a new ID column. Expressed as min(PlotSize)/max(PlotSize) remove all prior and future observations if TRUE.

Value

a list of plot and tree data.tables


standardize and treat the BC PSP data

Description

standardize and treat the BC PSP data

Usage

dataPurification_BCPSP(
  treeDataRaw,
  plotHeaderDataRaw,
  damageAgentCodes,
  codesToExclude = "IBM",
  excludeAllObs = TRUE
)

Arguments

treeDataRaw

the tree measurement csv

plotHeaderDataRaw

the plot header csv

damageAgentCodes

vector of damage agent codes

codesToExclude

damage agents to exclude from measurements

excludeAllObs

if removing observations of individual trees due to damage codes, remove all prior and future observations if TRUE.

Value

a list of plot and tree data.tables


standardize and treat the New Brunswick PSP data

Description

standardize and treat the New Brunswick PSP data

Usage

dataPurification_NBPSP(NB_PSP_Data, sppEquiv = LandR::sppEquivalencies_CA)

Arguments

NB_PSP_Data

list of data tables resulting from prepInputsNBPSP

sppEquiv

species equivalencies table with column Latin-full

Value

a list of standardized plot and tree data.tables


standardize and treat the NFI PSP data

Description

standardize and treat the NFI PSP data

Usage

dataPurification_NFIPSP(NFIdata, codesToExclude = "IB", excludeAllObs = TRUE)

Arguments

NFIdata

list of NFI tree, plot, and location data

codesToExclude

damage agents to exclude from measurements

excludeAllObs

if removing observations of individual trees due to damage codes, remove all prior and future observations if TRUE.

Value

a list of plot and tree data.tables


standardize and treat the Ontario PSP data

Description

standardize and treat the Ontario PSP data

Usage

dataPurification_ONPSP(ONPSPlist, sppEquiv = LandR::sppEquivalencies_CA)

Arguments

ONPSPlist

list of relevant plots

sppEquiv

table of species names - see LandR::sppEquiv- must have column 'latin' and 'PSP'

Value

a list of plot and tree data.tables


standardize and treat the QUEBEC PSP data

Description

standardize and treat the QUEBEC PSP data

Usage

dataPurification_QCPSP(
  QuebecPSP,
  codesToExclude = NULL,
  excludeAllObs = TRUE,
  sppEquiv = LandR::sppEquivalencies_CA
)

Arguments

QuebecPSP

list of PSP data.tables obtained via prepInputsQCPSP

codesToExclude

TODO: eventually add codes for pest disturbance if applicable

excludeAllObs

assuming codesToExclude is not NULL, exclude these obs or prior ones too

sppEquiv

table of species names - see LandR::sppEquiv

Value

a list of standardized plot and tree data.tables


standardize and treat the Saskatchewan PSP data

Description

standardize and treat the Saskatchewan PSP data

Usage

dataPurification_SKPSP(
  SADataRaw,
  plotHeaderRaw,
  measureHeaderRaw,
  treeDataRaw,
  codesToExclude = NULL,
  excludeAllObs = TRUE
)

Arguments

SADataRaw

the tree measurement csv

plotHeaderRaw

the plot header data

measureHeaderRaw

the measurement header raw

treeDataRaw

tree data

codesToExclude

damage agent codes used to filter tree data. Natural or Undetermined = 1, Disease = 2, Insect = 3, Human 4, Wind = 5, Snow = 6, Other Trees = 7, Hail or Ice Storm = 8. Measurements with these codes will be removed

excludeAllObs

if removing observations of individual trees due to damage codes, remove all prior and future observations if TRUE.

Value

a list of plot and tree data.tables


standardize and treat the Saskatchewan Mistik TSP data

Description

standardize and treat the Saskatchewan Mistik TSP data

Usage

dataPurification_SKTSP_Mistik(compiledPlotData, compiledTreeData)

Arguments

compiledPlotData

the plot header data

compiledTreeData

the tree data

Value

a list of plot and tree data.tables


convert plot location data to long/lat and output in a sf object

Description

convert plot location data to long/lat and output in a sf object

Usage

geoCleanPSP(Locations)

Arguments

Locations

the compiled plot data

Value

an sf object with OrigPlotID1 column


return a merged PSP object from a vector of data sources

Description

return a merged PSP object from a vector of data sources

Usage

getPSP(
  PSPdataTypes,
  destinationPath,
  forGMCS = FALSE,
  sppEquiv = LandR::sppEquivalencies_CA
)

Arguments

PSPdataTypes

character vector of PSP data sources - e.g. ⁠c("BC", "SK)"⁠ Use "all" to get all available sources, and "dummy" for freely availble data

destinationPath

destination folder for downloaded objects

forGMCS

if TRUE, will pre-filter plots with insect mortality to avoid attributing insect mortality with climate

sppEquiv

species equivalencies table.

Value

a list of standardized plot and tree data.tables


source the Alberta PSP data

Description

source the Alberta PSP data

Usage

prepInputsAlbertaPSP(dPath)

Arguments

dPath

passed to prepInputs destinationPath

Value

a list of Alberta PSP data.tables


Source the BC PSP data

Description

Source the BC PSP data

Usage

prepInputsBCPSP(dPath)

Arguments

dPath

passed to destinationPath in prepInputs()

Value

a list of BC PSP objects


retrieve the New Brunswick PSP raw data

Description

retrieve the New Brunswick PSP raw data

Usage

prepInputsNBPSP(dPath)

Arguments

dPath

data directory for raw data

Value

a list of plot, tree, measurement, and location data.tables after exporting mdb to csv txt


source the NFI PSP data

Description

source the NFI PSP data

Usage

prepInputsNFIPSP(dPath)

Arguments

dPath

passed to prepInputs destinationPath

Value

a list of NFI PSP data.tables


retrieve preprocessed Ontario PSP and PGP data

Description

retrieve preprocessed Ontario PSP and PGP data

Usage

prepInputsOntarioPSP(dPath, ...)

Arguments

dPath

the Access database for PSP and PGP plots

...

additional args passed to prepInputs

Value

a list of plot and tree data.tables


retrieve the Quebec PSP raw data

Description

retrieve the Quebec PSP raw data

Usage

prepInputsQCPSP(dPath)

Arguments

dPath

data directory for raw data

Value

a list of plot, tree, measurement, and location data.tables after exporting mdb to csv txt


source the Saskatchewan PSP data

Description

source the Saskatchewan PSP data

Usage

prepInputsSaskatchwanPSP(dPath)

Arguments

dPath

passed to prepInputs destinationPath

Value

a list of Saskatchewan PSP data.tables


source the Saskatchewan PSP data

Description

source the Saskatchewan PSP data

Usage

prepInputsSaskatchwanTSP(dPath)

Arguments

dPath

passed to prepInputs destinationPath

Value

a list of Saskatchewan PSP data.tables


standardize and treat the BC PSP data

Description

standardize and treat the BC PSP data

Usage

prepPSP_climateNA(dPath, filename2, PSPplot, PSPgis)

Arguments

dPath

directory to download elevation data

filename2

the full filename of the output file

PSPplot

the standardized PSP plot attribute data

PSPgis

the standardized plot location sf object

Value

a text file


standardize the species names in a given PSP measurement data.table

Description

standardize the species names in a given PSP measurement data.table

Usage

standardizeSpeciesNames(speciesTable, forestInventorySource)

Arguments

speciesTable

the tree measurement csv

forestInventorySource

one of MBTSP, ABPSP, BCPSP, SKPSP, NWTTSP, NFIPSP.

Value

the species table with standardized species names