knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(lfcdata)

NFI database

Tables available

Tables available to get data from can be consulted this way:

nfidb <- nfi()
nfi_avail_tables(nfidb)

Table naming conventions

Plots info:

Plot level results:

Functional group broken down results:

Other tables:

Description of a table can be obtained with nif_describe_table function:

nfi_describe_table(nfidb, 'plot_nfi_4_results')

Variables info

Information about variables can be consulted in console:

nfi_describe_var(nfidb, c('density', 'basal_area'))

Complete list of NFI variables

vars <- nfi_get_data(nfidb, 'variables_thesaurus') |>
  dplyr::pull(var_id) |>
  unique() |> 
  sort()
for (var in vars) {
  nfi_describe_var(nfidb, var)
  cat('----------------\n\n')
}

Allometries database

Tables available

Allometries database only offers one table, allometries. This table contains all the allometries and their information:

allomdb <- allometries()
allometries_get_data(allomdb)

Variables info

Information about variables can be consulted in console:

allometries_describe_var(allomdb, 'param_a')

It also can be used to describe in detail the independent and dependent variables:

allometries_describe_var(allomdb, c('DR', 'DBH'))

LiDAR database

Tables available

The LiDAR database offers precalculated and aggregated data for administrative divisions and natural areas in Catalonia. Tables available can be consulted:

lidardb <- lidar()
lidar_avail_tables(lidardb)

And data retrieved:

lidar_get_data(lidardb, 'lidar_provinces')

Also, database offers low resolution raster tables (cell size of 400m x 400m), in the form of stars or raster objects:

lidar_get_lowres_raster(lidardb, c('REC', 'DBH'))

Raw data (20m x 20m rasters) can not be downloaded, but data can be consulted for user provided polygons with the lidar_clip_and_stats function. See ?lidar_clip_and_stats for more information.

Variables info

Information about the biophysic variables available in the LiDAR database can be consulted:

lidar_describe_var(lidardb, 'AB')

Complete list of LiDAR variables

lidar_describe_var(lidardb, c('AB', 'BAT', 'BF', 'CAT', 'DBH', 'HM', 'REC', 'VAE'))

Forest Ecosystem Services (FES) for Catalunya database

Tables available

FES database offers precalculated data for NFI plots as well as for static ecosystem service data. Available tables can be listed using fes_avail_tables:

fesdb <- fes()
fes_avail_tables(fesdb)

And data can be retrieved with fes_get_data, in both, table or spatial (sf) formats:

fes_get_data(fesdb, 'plot_nfi_4_results')
fes_get_data(fesdb, 'plot_nfi_4_results', spatial = TRUE)

Tables and variables information

To know more about a table, we have fes_describe_table:

fes_describe_table(fesdb, 'plot_nfi_4_results')

If we want to know more about a variable, we will use fes_describe_var:

fes_describe_var(fesdb, 'mushrooms_production')

Meteoland database

Raster data access

Meteoland database is somewhat special, as there is no get_data method. All data in this database is spatial data, so we will use the meteoland_get_lowres_raster method to access the data:

meteolanddb <- meteoland()
meteolanddb

For this to work, a character vector indicating a date in YYYY-MM-DD must be provided:

meteoland_get_lowres_raster(meteolanddb, date = as.character(Sys.Date() - 1))

CatDrought database

Raster data access

CatDrought database is similar to Meteoland database, in the sense that they don't have get_data method. Again, all data in this database is spatial data, so we can use the catdrought_get_raster method to access the data:

catdroughtdb <- catdrought()
catdroughtdb

We need to provide a date (character vector in YYYY-MM-DD format):

catdrought_get_raster(
  catdroughtdb,
  date = as.character(Sys.Date() - 1)
)


MalditoBarbudo/lfcdata documentation built on May 2, 2023, 10:30 p.m.