View source: R/prices_scores.R
cereal_cost | R Documentation |
This function takes in the cost of healthier and regular cereal and compares them to return a NEMS-S score for the cost.
cereal_cost(healthier_cereal_price, regular_cereal_price)
healthier_cereal_price |
The price of healthier cereal. |
regular_cereal_price |
The price of regular cereal. |
This function implements the scoring method described in Table 4.1 of Lundsford (2016). "Healthier cereal" has less than 7g of sugar per serving.
The NEMS-S points associated with cereal cost.
healthier_cereal_price <- rnorm(10,4.1,.5) regular_cereal_price <- rnorm(10,3.5,.3) cereal_cost(healthier_cereal_price, regular_cereal_price )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.