Learn R Programming

inegiR (version 3.0.0)

inegi_denue_grid: Find businesses in a grid larger than 5 kms

Description

Returns data.frame with businesses registered in the DENUE in spaces larger than 5 kilometers. Calls make_grid. Functions contributed by Arturo Cardenas https://github.com/arturocm.

Usage

inegi_denue_grid(lat1, lat2, lon1, lon2, token, meters = 5000,
  keyword = "todos", space_lat = 0.07, space_lon = 0.07,
  uniqueonly = TRUE)

Arguments

lat1

First corner (latitud)

lat2

Second corner (latitud)

lon1

First corner (longitud)

lon2

Second corner (longitud)

token

API token supplied by INEGI

meters

Distance in meters to search by coordinate

keyword

Keyword of businesses to include. Defaults to all ("todos")

space_lat

Space between latitud coordinates defaults to 0.07 degrees

space_lon

Space between longitud coordinates defaults to 0.07 degrees

uniqueonly

Default = TRUE, eliminates duplicate businesses

Value

Data.frame

Details

Makes a loop for each pair of coordinates, creating a grid to extract businesses inside. Uses maximum and minimum coordinate pairs to draw frame.

Examples

Run this code
# NOT RUN {
token<-"webservice_token"
latitud1 <- 25.669194
latitud2 <- 25.169194
longitud1 <- -100.30990
longitud2 <- -101.20102
businesses <- inegi_denue_grid(latitud1, latitud2, longitud1, longitud2, token)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab