Learn R Programming

flightplot (version 0.1.0)

get_map_border: Helper function to calculate the coordinate limits of map border

Description

Since the world map is huge, and flights are usually drawn in a relatively small area, the map needs to be cropped based on the coordinates of airports used. This function generates the coordinate limits of the cropped map.

Usage

get_map_border(v, type = c("long", "lat"), padding_ratio = 0.1)

Arguments

v

A double numeric vector - vector of longtitudes/latitudes.

type

A string - "long" or "lat". It indicates whether longtitudes or latitudes are input.

padding_ratio

A double number - 0 to 1. The padding ratio is defined as padding / (maximum - minimum)

Value

A two-column dataframe

Examples

Run this code
# NOT RUN {
get_map_border(c(-20,30,60,85), type = "lat")
get_map_border(c(-10,0,10,40), type = "long", padding_ratio = 0.2)

# }

Run the code above in your browser using DataLab