legend_range: Get the distance in kilometers between two points.

View source: R/legend_range.R

legend_rangeR Documentation

Get the distance in kilometers between two points.

Description

Get the distance in kilometers between two points.

Usage

legend_range(
  x,
  y,
  text.width = NULL,
  dig = c(2, 2, 2),
  xjust = 0.5,
  horiz = TRUE,
  y.intersp = 0.1,
  x.intersp = 0.1,
  show.mean = TRUE,
  unit = "",
  label_mean = "ALL:",
  ...
)

Arguments

x

raster or array

y

raster or array to mean (x is used only for the range in this case)

text.width

Longitude in decimals

dig

vector with number of digits for plot

xjust

passed to legend

horiz

passed to legend

y.intersp

passed to legend

x.intersp

passed to legend

show.mean

set TRUE to hide mean value

unit

a string for units

label_mean

label in case y is provided

...

extra arguments passed to legend

Note

for use with raster use before any change of projection

text.width can vary depending on map dimensions

Examples

library(raster)
br <- shapefile(paste0(system.file("extdata",package="hackWRF"),"/BR_states.shp"),verbose=FALSE)
plot(br)
box()
latitude()
longitude()
grid()
x <- eixport::wrf_get(paste0(system.file("extdata",package="hackWRF"),"/wrfinput_d01"),'XLAT')
legend_range(x)


Schuch666/hackWRF documentation built on June 9, 2025, 1:46 p.m.