knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(lfcdata)
Tables available to get data from can be consulted this way:
nfidb <- nfi() nfi_avail_tables(nfidb)
Plots info:
plots
: main table containing the static-in-time information about plots. plots_nfi_X_dynamic_info
: tables containing the dynamic-in-time information about
plots for each nfi versionPlot level results:
plot_nfi_X_[diamclass]_results
: tables with the data for the X
nfi version. diamclass
indicates plot data broken down by diameter classes. plot_comp_nfiX_nfiY_[diamclass]_results
: tables with the data for nfi X
and Y
versions comparisions. diamclass
indicates plot data broken down by diameter classes.Functional group broken down results:
[fg]_nfi_X_[diamclass]_results
: tables with the data for the X
nfi version, broken
down by functional group value. diamclass
indicates data broken down by diameter classes. fg
can be species
, genus
, simpspecies
(simplified list of species, with
some of them grouped), dec
(deciduous - esclerophyll - conifer) and
bc
(broadleaves - conifer) [fg]_comp_nfiX_nfiY_[diamclass]_results
: tables with the data for nfi X
and Y
versions comparisions, broken down by functional group value. diamclass
indicates data broken down by diameter classes. fg
can be species
, genus
, simpspecies
(simplified list of species, with
some of them grouped), dec
(deciduous - esclerophyll - conifer) and
bc
(broadleaves - conifer) Other tables:
regeneration_nfi_X
: regeneration (small trees) tables for X
nfi version. These
tables are always broken down by species. shrub_nfi_X_info
: Shrubs information tables for X
nfi version. These
tables are always broken down by species.Description of a table can be obtained with nif_describe_table
function:
nfi_describe_table(nfidb, 'plot_nfi_4_results')
Information about variables can be consulted in console:
nfi_describe_var(nfidb, c('density', 'basal_area'))
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 only offers one table, allometries
. This table contains all the
allometries and their information:
allomdb <- allometries() allometries_get_data(allomdb)
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'))
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.
Information about the biophysic variables available in the LiDAR database can be consulted:
lidar_describe_var(lidardb, 'AB')
lidar_describe_var(lidardb, c('AB', 'BAT', 'BF', 'CAT', 'DBH', 'HM', 'REC', 'VAE'))
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)
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 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 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) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.