milk_avail: Compute milk availability points

View source: R/prices_scores.R

milk_availR Documentation

Compute milk availability points

Description

This function takes in the number of lowfat and whole milk varieties at a given store and returns the NEMS-S points associated with the availability.

Usage

milk_avail(lowfat_milk_varieties, whole_milk_varieties)

Arguments

lowfat_milk_varieties

The number of low fat milk cartons available.

whole_milk_varieties

The number of whole milk cartons available.

Details

This function implements the scoring method described in Measure 1 of the NEMS-S Protocol. "Low-fat milk" is considered skim milk or 1 percent fat, whichever is available.

Value

The NEMS-S points associated with milk availability.

Examples

lowfat_milk_varieties <- rnorm(10,,)
whole_milk_varieties <- rnorm(10,,)
milk_avail(lowfat_milk_varieties, whole_milk_varieties)


byu-transpolab/nemsr documentation built on Feb. 10, 2023, 11:24 p.m.