Railfunction: Nutrient rails

Description Usage Arguments Value Examples

Description

This function generates a rail plot demonstrating the nutrient balance of foods. All you need to do is input 2 nutrients and a grouping variable, and voila!

Usage

1
Railfunction(data, x, y, id, group = FALSE)

Arguments

data

the dataframe holding your data

x

X axis nutrient (will be labelled on an energy (kCal) basis)

y

Y axis nutrient (will be labelled on an energy (kCal) basis)

id

an optional argument. Grouping variable or other indicator of multiple groups within your dataset.

group

Default is FALSE. Where group=FALSE, intake rail will be generated for entire dataset. Where group=TRUE, intake rail will be generated for each group.

Value

A complete plot demonstrating the intake rail(s), as well as the ratio of Nutrient X to Y

Examples

1
Railfunction(baboondailyintake,carb,fat,individualname,group=TRUE)

PrimateEats/balancr documentation built on May 16, 2019, 11:10 p.m.