Learn R Programming

EHR (version 0.4-11)

stdzStrength: Standardize Strength Entity

Description

This function standardizes the strength entity.

Usage

stdzStrength(str, freq)

Value

numeric vector

Arguments

str

character vector of extracted strength values

freq

character vector of extracted frequency values

Details

Some strength strings may include multiple values and additional interpretation may be needed. For example ‘2-1’ likely indicates a strength of 2 followed by a strength of 1. Thus a single element may need to be standarized into two elements. This can only happen if the frequency entity is missing or in agreement (‘bid’ for example). See the ‘addl_data’ attribute of the returned vector.

Examples

Run this code
stdzStrength(c('1.5', '1/2', '1/1/1'))
stdzStrength(c('1.5', '1/2', '1/1/1'), c('am', 'daily', NA))
stdzStrength(c('1.5', '1/2', '1/1/1'), FALSE)

Run the code above in your browser using DataLab