auto_limits: Automatic limits for basemap

View source: R/auto_limits.R

auto_limitsR Documentation

Automatic limits for basemap

Description

Find limits for a basemap from a data frame.

Usage

auto_limits(
  data,
  lon = NULL,
  lat = NULL,
  proj.in = 4326,
  proj.out = NULL,
  expand.factor = NULL,
  verbose = FALSE
)

Arguments

data

Data frame or a spatial object containing data for which the limits should be calculated.

lon, lat

Names of longitude and latitude columns in data as character or integer index. If NULL, the column names are guessed.

proj.in

Original CRS projection. Must be defined as character argument.

proj.out

Resulting map projection. See transform_coord.

expand.factor

Expansion factor for map limits. Set to NULL to ignore.

verbose

Logical indicating whether information about the projection and guessed column names should be returned as message. Set to FALSE to make the function silent.

Details

This is an internal function, which is automatically run by the basemap function.

Value

A list of limits and projections in proj.in and proj.out formats.

Author(s)

Mikko Vihtakari

See Also

Other customize shapefiles: reorder_layers(), theme_map()

Examples

auto_limits(data = expand.grid(lon = c(-120, 180, 120),
   lat = c(60, 60, 80)))

ggOceanMaps documentation built on May 29, 2024, 5:36 a.m.