Learn R Programming

dggridR (version 3.1.0)

dg_closest_res_to_cls: Determine an appropriate grid resolution based on a desired characteristic length scale of the cells.

Description

The characteristic length scale (CLS) is the diameter of a spherical cap of the same area as a cell of the specified resolution.

Usage

dg_closest_res_to_cls(
  dggs,
  cls,
  round = "nearest",
  show_info = TRUE,
  metric = TRUE
)

Value

A number representing the grid resolution

Arguments

dggs

A dggs object from dgconstruct()

cls

The desired CLS of the 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)

Examples

Run this code
library(dggridR)
dggs <- dgconstruct(res=20)
res  <- dg_closest_res_to_cls(dggs,1)
dggs <- dgsetres(dggs,res)

Run the code above in your browser using DataLab