format_id: Format ID

View source: R/format_id.R

format_idR Documentation

Format ID

Description

Formats ID field into a standard format to support reporting.

Usage

format_id(df, id_field)

Arguments

df

data frame; Data frame containing the id_field to be formatted.

id_field

character; The column name of the id field to be formatted.

Details

The input 'id_field' is assumed to contain three parts: an alphabetic code, a dash separator, a sequential numeric second part, and an alphabetic third part.

Value

The input data frame with a new field formatted according the function's format rules.

Examples

# Get test data
db_risk <- rarr::db_risk

# Cleanup risk number for sorting
risk <- rarr::format_id(db_risk, "RISK_NO")


MVR-GIS/rarr documentation built on March 4, 2023, 11:47 p.m.