dg_closest_res_to_spacing: Determine grid resolution from desired spacing.

View source: R/dggridR.R

dg_closest_res_to_spacingR Documentation

Determine grid resolution from desired spacing.

Description

Determine an appropriate grid resolution based on a desired spacing between the center of adjacent cells.

Usage

dg_closest_res_to_spacing(
  dggs,
  spacing,
  round = "nearest",
  show_info = TRUE,
  metric = TRUE
)

Arguments

dggs

A dggs object from dgconstruct()

spacing

The desired spacing between the center of adjacent cells

round

What direction to search in. Must be nearest, up, or down.

show_info

Print the area, spacing, and CLS of the chosen resolution.

metric

Whether input and output should be in metric (TRUE) or imperial (FALSE)

Value

A number representing the grid resolution

Examples

library(dggridR)
dggs <- dgconstruct(res=20)
res  <- dg_closest_res_to_spacing(dggs,1)
dggs <- dgsetres(dggs,res)

dggridR documentation built on Sept. 11, 2024, 6:58 p.m.