plot_hex_data: plot_hex_data

View source: R/plot_hex_data.R

plot_hex_dataR Documentation

plot_hex_data

Description

This function plots the gridded data from assess_privacy

Usage

plot_hex_data(
  data_sf = NULL,
  plotfld = NULL,
  extent = "data",
  hideEmptyCells = TRUE
)

Arguments

data_sf

default is NULL. an sf version of the Grid2Min object from assess_privacy.

plotfld

default is NULL. This is a single field within the data object that you want to plot. Leaving it NULL results in a popup box of selectable fields.

extent

default is "data". This controls the extent of the output plot. It can be one of "data", "layer", or a vector of coordinates corresponding with xmin, xmax, ymin, ymax (e.g. bbox = c(-65,-63,43,45).

  • "data" - results in the plot being restricted to an area where values of plotfld are non-zero

  • "layer" - results in the plot showing the full extent of the gridded area

  • c(xmin, xmax, ymin, ymax) - results in a plot restricted to the specified area

hideEmptyCells

default is TRUE. By default, this parameter results in the plot only showing grid cells for which data exists (i.e. non-zero). This offers a dramatic performance improvement. If the entire mesh of predominantly empty cells must be shown, set this to FALSE.

Value

an ggplot2 plot

Note

if no PID or POS is provided, it is assumed that the provided positions are for a single polygon and the position are in the correct order.

Author(s)

Mike McMahon, Mike.McMahon@dfo-mpo.gc.ca

See Also

Other privacy: assess_privacy()


Maritimes/Mar.utils documentation built on Feb. 12, 2024, 11:38 p.m.