View source: R/prices_scores.R
juice_drinks_cost | R Documentation |
This function takes in the cost of diet soda, regular soda, 100 percent juice and regular juice drinks and compares them to return an NEMS-S score for the cost.
juice_drinks_cost( diet_soda_price, regular_soda_price, healthier_juice_drinks_price, regular_juice_drinks_price )
diet_soda_price |
The price of regular soda. |
regular_soda_price |
The price of healthier soda. |
healthier_juice_drinks_price |
The cost of 100 percent juice drinks. |
regular_juice_drinks_price |
The cost of non 100 percent juice drinks. |
This function implements the scoring method described in Table 4.1 Lundsford (2016). "Healthy juice" is 100 percent juice drinks, natural fruit juice with no added sugars. "Regular juice" is fruit juice with added sugar and water.
The NEMS_S points associated with soda price compared to juice price.
diet_soda_price <- rnorm(10,4.1,.5) regular_soda_price <- rnorm(10,4.1,.3) healthier_juice_drinks_price <- rnorm(10,4.1,.5) regular_juice_drinks_price <- rnorm(10,4.1,.3) juice_drinks_cost(diet_soda_price, regular_soda_price, healthier_juice_drinks_price, regular_juice_drinks_price)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.