Package 'mapindiatools'

Title: Mapping Data for 'mapindia' Package
Description: Provides a container for data used by the 'mapindia' package. The data used by 'mapindia' has been extracted into this package so that the file size of the 'mapindia' package can be reduced considerably. The data in this package will be updated when latest data is available.
Authors: Shubham Dutta [aut, cre, cph]
Maintainer: Shubham Dutta <[email protected]>
License: MIT + file LICENSE
Version: 1.0.1.9000
Built: 2024-11-01 05:18:55 UTC
Source: https://github.com/shubhamdutta26/mapindiatools

Help Index


Retrieve centroid labels

Description

Retrieve centroid labels

Usage

centroid_labels(regions = c("states", "districts"))

Arguments

regions

The region breakdown for the map, can be one of ("states", "districts", as specified by the internal file names. The default is "states".

Value

An 'sf' data frame of state or district centroid labels and positions relative to the coordinates returned by the map_india function.


Retrieve state and district codes

Description

Retrieve state and district codes

Usage

fetch_codes(regions = c("states", "state", "districts", "district"))

Arguments

regions

The region breakdown for the map, can be one of ("states", "state", "districts", "district"). The default is "states".

Value

An data frame of codes of the desired regions.

Examples

str(fetch_codes())

state_codes <- fetch_codes()

district_codes <- fetch_codes(regions = "districts")

Retrieve Indian mapping data

Description

Retrieve Indian mapping data

Usage

map_india(
  regions = c("states", "state", "districts", "district"),
  include = c(),
  exclude = c()
)

Arguments

regions

The region breakdown for the map, can be one of ("states", "state", "districts", "district"). The default is "states".

include

The regions to include in the resulting map. If regions is "states"/"state", the value can be either a state name, abbreviation or code. If states are provided in the district map, only ditricts in the included states will be returned.

exclude

he regions to exclude in the resulting map. If regions is "states"/"state", the value can be either a state name, abbreviation or code. The regions listed in the include parameter are applied first and the exclude regions are then removed from the resulting map. Any excluded regions not present in the included regions will be ignored.

Value

An 'sf' data frame of indian map coordinates divided by the desired regions.

Examples

str(map_india())

df <- map_india(regions = "districts")

include_states <- map_india(include = c("WB", "NL", "AP"))

exclude_states <- map_india(exclude = c("WB", "NL", "AP"))