Description Usage Arguments Details Value Examples
View source: R/get_asp_ratio.R
Get the aspect ratio of a shape object, a tmap
object, or a bounding box
1 | get_asp_ratio(x, is.projected = NA, width = 700, height = 700, res = 100)
|
x |
A shape from class |
is.projected |
Logical that determined wether the coordinates of |
width |
See details; only applicable if |
height |
See details; only applicable if |
res |
See details; only applicable if |
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.
aspect ratio
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | if (require(tmap) && packageVersion("tmap") >= "2.0") {
data(World)
get_asp_ratio(World)
get_asp_ratio(bb(World))
tm <- qtm(World)
get_asp_ratio(tm)
}
## Not run:
get_asp_ratio("Germany") #note: bb("Germany") uses geocode_OSM("Germany")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.