Learn R Programming

tmap (version 1.6)

get_asp_ratio: Get aspect ratio

Description

Get the aspect ratio of a shape object, i.e., the map width devided by the map height.

Usage

get_asp_ratio(x = NULL, width = 700, height = 700, res = 100)

Arguments

x
shape object (either Spatial or a Raster) or a tmap object. If x is not specified, the last_map is taken.
width
See details; only applicable if x is a tmap object.
height
See details; only applicable if x is a tmap object.
res
See details; only applicable if x is a tmap object.

Value

aspect ratio

Details

The arguments width, height, and res are passed on to png. If x is a tmap object, a temporarily png image is created to calculate the aspect ratio of a tmap object. The default size of this image is 700 by 700 pixels at 100 dpi.