admin_to_num: Convert Administrative Level String to Numeric Code
Description
This function converts administrative level names (e.g., "National", "Admin-1")
into corresponding numerical values.
Usage
admin_to_num(admin_level)
Value
An integer representing the numerical level:
- "National" is converted to 0.
- "Admin-X" is converted to X as an integer.
- Returns NULL if the input is invalid.
Arguments
admin_level
A character string representing the administrative level.
It can be "National" or "Admin-X" (where X is a positive integer).