Creates a list of forest objects from Spanish Forest Inventory (IFN) data in its second (IFN2), third (IFN3; DGCN 2005) and fourth (IFN4) editions.

IFN2forest(
  pies_mayores,
  IFN_species_mapping,
  SpParams,
  pies_menores = NULL,
  regenera = NULL,
  matorral = NULL,
  herb_data = NULL,
  setDefaults = TRUE,
  filterWrongRecords = TRUE,
  filterDeadTrees = TRUE,
  keepNumOrden = TRUE,
  keepSpeciesCode = TRUE,
  minDBH = 1,
  verbose = TRUE
)

Arguments

pies_mayores

A data frame with measured tree data (PCPiesMayores).

IFN_species_mapping

A data frame with the mapping from IFN species codes to medfate species names (see IFN_species_mapping).

SpParams

A data frame with medfate species parameters (see SpParamsMED).

pies_menores

A data frame with measured regeneration tree data (PCPiesMenores in IFN2).

regenera

A data frame with measured regeneration tree data (PCRegenera in IFN3 and IFN4).

matorral

A data frame with measured shrub data (PCMatorral).

herb_data

A data frame with cover and mean height of the herb layer for each forest plot.

setDefaults

Initializes default values for missing fields in IFN data.

filterWrongRecords

Filters wrong records (records with missing values, zero values or wrong growth forms). This should normally result in the removal of dead/cut trees.

filterDeadTrees

Filters dead trees (with OrdenIf3 or OrdenIf4 equal to "888" or "999")

keepNumOrden

Keeps num orden as additional column (OrdenIf2, OrdenIf3 or OrdenIf4) to identify trees.

keepSpeciesCode

Keeps IFN species code.

minDBH

Minimum diameter threshold to filter out small trees

verbose

A boolean flag to indicate console output.

Value

A list of forest objects.

Details

IFN input data needs to be in a specific format, following IFN specifications.

  • For pies_mayores, the following columns are required:

    • ID: Plot ID string

    • Especie: String of tree IFN species code (will be mapped to medfate code).

    • Dn1: Diameter at breast height (in mm), first measurement.

    • Dn2: Diameter at breast height (in mm), second measurement.

    • Ht: Total tree height (in m)

  • For pies_menores, the following columns are required:

    • ID: Plot ID string

    • Especie: String of tree IFN species code (will be mapped to medfate code).

    • Numero: Number of stems for 2.5-7.5 cm DBH class.

    • Hm: Average height (in dm).

    • Regena: Regeneration code ('0', 1', '2', '3').

  • For regenera, the following columns are required:

    • ID: Plot ID string

    • Especie: String of tree IFN species code (will be mapped to medfate code).

    • CatDes: Regeneration category ( 1', '2', '3' or '4').

    • Densidad: Density category ( 1', '2', or '3').

    • NumPies: Number of stems for 2.5-7.5 cm DBH class.

    • Hm: Average height (in dm).

  • For matorral, the following columns are required:

    • ID: Plot ID string.

    • Especie: String of shrub IFN species code (will be mapped to medfate code).

    • Fcc: Numeric values of shrub cover (in %).

    • Hm: Average shrub height (in dm).

Function IFN2forest call translateSpeciesCodes internally to translate IFN codes into medfate codes.

References

DGCN (2005). Tercer Inventario Forestal Nacional (1997-2007): Catalunya. Dirección General de Conservación de la Naturaleza, Ministerio de Medio Ambiente, Madrid.

Author

Miquel De Cáceres Ainsa, EMF-CREAF

Examples

# Medfate species parameters
data(SpParamsMED)

# Species mapping from IFN
data(IFN_species_mapping)

# Builds from IFN2 data a list whose elements are 'forest' objects
data(piesMenoresIFN2)
data(piesMayoresIFN2)
data(matorralIFN2)
l <- IFN2forest(piesMayoresIFN2, IFN_species_mapping,
               SpParams = SpParamsMED,
               matorral = matorralIFN2, pies_menores = piesMenoresIFN2)
#> Number of plots: 5
#> Filtering missing and zero values...
#> Filtering small trees (DBH < 1) ...
#> Filtering dead trees...
#> Translating species codes...
#> Tree data records with unrecognized IFN species codes: 1/117 (0.9%)
#> 
#> 0099 
#>    1 
#> Shrub data records with unrecognized IFN species codes: 5/20 (25%)
#> 
#> 0103 
#>    5 
#> Filtering wrong growth forms ...
#> Setting default root distribution ...
#> Building forest objects...
#> done.

# Plot codes are in list names
names(l)
#> [1] "081065" "081066" "081067" "081068" "081069"


# Builds from IFN3 data a list whose elements are 'forest' objects
data(piesMayoresIFN3)
data(regeneraIFN3)
data(matorralIFN3)
l <- IFN2forest(piesMayoresIFN3, IFN_species_mapping,
               SpParams = SpParamsMED,
               matorral = matorralIFN3, regenera = regeneraIFN3)
#> Number of plots: 5
#> Filtering missing and zero values...
#> Filtering small trees (DBH < 1) ...
#> Filtering dead trees...
#> Translating species codes...
#> Filtering wrong growth forms ...
#> Setting default root distribution ...
#> Building forest objects...
#> done.