flget_bathymetry {FjordLight} | R Documentation |
FjordLight
.This functions will conveniently extract the bathymetry data stored within a
NetCDF file downloaded via fl_DownloadFjord
. There are options
for how the user would like to subset the data, which data format the data
should be extracted to, and if the user would like to plot the data in the process.
flget_bathymetry(fjord, what = "o", mode = "raster", PLOT = FALSE)
fjord |
Expects the object loaded via |
what |
The default value |
mode |
Determines the format of the bathymetry data loaded into the R environment.
The default |
PLOT |
Boolean argument (default = |
Depending on which arguments the user chooses, this function will return the
filtered bathymetry data as a RasterLayer
(mode = "raster"
) or
data.frame (mode = "df"
). The data.frame will contain the following columns:
longitude |
degree decimals |
latitude |
degree decimals |
depth |
metres |
Note that the depth column will contain both elevation (positive) and depth (negative) values.
Bernard Gentili & Robert Schlegel
# Load data
fjord_code <- "test"
fjorddata <- fl_LoadFjord(fjord_code, dirdata = system.file("extdata", package = "FjordLight"))
# Shallow data (what = "s"; s for shallow) as a data.frame
shallow_df <- flget_bathymetry(fjorddata, what = "s", mode = "df")
# Plot all ocean and land data
full_bathy <- flget_bathymetry(fjorddata, what = "ol", mode = "raster", PLOT = TRUE)
# Plot only land data
land_only <- flget_bathymetry(fjorddata, what = "l", mode = "raster", PLOT =TRUE)
# For more examples see: https://face-it-project.github.io/FjordLight/articles/fl_example.html