R/Plot.R
zoom_lon_lat.Rd
This function is applied by plot_lon_lat() to set the zoom based on 0 or more arguments and the actual data to be plotted. Providing no arguments returns the full extent of the data.
zoom_lon_lat(
x,
lon_name = "lon",
lat_name = "lat",
xmin = NA,
xmax = NA,
ymin = NA,
ymax = NA,
zoom = 1,
zoomCenter = c(0.5, 0.5)
)
A data.table with data, including the longitude and latitude variables specified by the arguments lon_name
and lat_name
.
Character: The name of the longitude and latitude variable in the data x
.
Numeric: The optional extremes of the plot, where x is longitude and y is latitude. Setting only xmin sets only the lower longitude limit, etc.
Numeric: The zoom of the plot, where 1 is no zoom and 2 zooms out to double extent of the plot, etc.
Numeric: The center of the plot relative to the limits of the plot before zooming.