# From data
calc_zoom(lon, lat, wind)
# From range
lon_range <- extendrange( wind$lon )
lat_range <- extendrange( wind$lat )
calc_zoom(lon_range, lat_range)
# From bounding box
box <- make_bbox(lon, lat, data = crime)
calc_zoom(box)
Run the code above in your browser using DataLab