R/isPrimary.R

Defines functions isPrimary

Documented in isPrimary

##' This function tests whether a commodity is a primary item.
##'
##' HACK (Michael): This is a hack from Josh, a list should be provided.
##'
##' @param itemCode The item code to be tested
##' @param primaryPattern The regular expression pattern corresponds to primary
##'     commodities.
##'
##' @return logical, whether the item is a primary commodity
##'
##' @export
##'

isPrimary = function(itemCode, primaryPattern = "^0"){
    grepl(primaryPattern, itemCode)
}
SWS-Methodology/faoswsProduction documentation built on March 21, 2023, 8:27 p.m.