Learn R Programming

naijR (version 0.6.1)

disambiguate_lga: Disambiguate Synonymous States and LGAs

Description

Some LGAs in Nigeria bear the name of the States to which they belong to. This function will apply an attribute to such an LGA to distinguish it from its State.

Usage

disambiguate_lga(lga, state = NULL, ...)

Value

The object of class lgas with the (possibly) modified State attribute.

Arguments

lga

An object of class lgas of length 1L.

state

The name of the State to which the LGA is to belong to.

...

Arguments to be passed to menu.

Details

For state, if it is not provided by the user, an interactive prompt will be presented to the user to select the appropriate state - but only in interactive sessions; if run as a batch command, this function will signal an error.

Examples

Run this code
obi.lga <- lgas("Obi")    # Warning
try(map_ng(obi.lga))      # Error

obi.benue <- disambiguate_lga(obi.lga, "Benue")

if (interactive())
  map_ng(obi.benue)

Run the code above in your browser using DataLab