extract_atc_codes: Extract ATC Codes from Text

extract_atc_codesR Documentation

Extract ATC Codes from Text

Description

This function extracts ATC codes from a character vector containing text formatted as "ATC code (percentage)". It uses a regular expression to find the ATC codes before the parentheses. Function is for internal use for creating error messages in the package.

Usage

extract_atc_codes(text)

Arguments

text

a character vector containing text from which ATC codes need to be extracted. The expected format is "ATC code (percentage)".

Value

a character vector of extracted ATC codes. If no matches are found, it returns an empty character vector.


piavat/PRE2DUP-R documentation built on June 11, 2025, 11:42 a.m.