Skip to contents

If grid and grid_to are both vectors, the distance between grid and grid_to is calculated. If grid is a list, The path distance of each element is calculated.

Usage

grid_distance(
  grid,
  grid_to = NULL,
  close = FALSE,
  type = c("keep_na", "ignore_na", "skip_na")
)

Arguments

grid

A grid vector or a list of grid vector.

grid_to

A grid vector.

close

Should the path of each element be closed when grid is a list?

type

How is the NA grid treated when grid is a list? "skip_na" skips the NA grid and connects the paths. "keep_na" by default.

Value

A double vector.