Skip to contents

create_meal_plan() expects a RecipeBook-class object as input. The available options for customizing the meal plan include; the days of the week and the meals ("Lunch" or "Dinner") to plan for, the method to use and whether to only use favourite recipes.

Usage

create_meal_plan(
  recipebook,
  which_days = weekdays(),
  which_meals = c("Lunch", "Dinner"),
  method = c("auto", "random"),
  fav_only = FALSE,
  set_last_eaten = TRUE
)

Arguments

recipebook

a RecipeBook-class object.

which_days

character() which days of the week to plan for, in the format "Mon"

which_meals

character() which meals to plan for, one of "Lunch" or "Dinner".

method

character() the method to use when creating a meal plan, one of "auto", or "random".

fav_only

logical() whether to only pick from favourite recipes.

set_last_eaten

logical() whether to record the that selected recipes were used for a meal plan today. This info is taken into account when optimising the meal planning algorithm if method is set to "auto".

Value

a RecipeBook-class object containing the created meal_plan.

Examples

recipebook <- create_meal_plan(recipebook_example)

meal_plan(recipebook)
#> # A tibble: 14 × 7
#>    day   meal   recipe_index names                  ingredients fav   last_eaten
#>    <fct> <fct>         <int> <chr>                  <list>      <lgl> <date>    
#>  1 Mon   Lunch            14 Roast Mushroom, Creme… <Ingrdnts>  FALSE 2022-03-26
#>  2 Mon   Dinner            7 Steak Tagliata & Roas… <Ingrdnts>  FALSE 2022-03-26
#>  3 Tues  Lunch             4 Chickpea & Sweet Pota… <Ingrdnts>  FALSE 2022-03-26
#>  4 Tues  Dinner            8 Sweetcorn & Spring On… <Ingrdnts>  FALSE 2022-03-26
#>  5 Wed   Lunch            15 Globe Arichoke & Pine… <Ingrdnts>  FALSE 2022-03-26
#>  6 Wed   Dinner           23 Hoisin Beef Noodles &… <Ingrdnts>  FALSE 2022-03-26
#>  7 Thurs Lunch             2 Crispy Duck with Fava… <Ingrdnts>  FALSE 2022-03-26
#>  8 Thurs Dinner           20 Provencal Butterbean … <Ingrdnts>  FALSE 2022-03-26
#>  9 Fri   Lunch            21 Chickpea Falafels wit… <Ingrdnts>  FALSE 2022-03-26
#> 10 Fri   Dinner           25 Korean Beef & Kimchi … <Ingrdnts>  FALSE 2022-03-26
#> 11 Sat   Lunch            26 Afghan Spliced Squash  <Ingrdnts>  FALSE 2022-03-26
#> 12 Sat   Dinner           10 Chipotle, Corn & Chee… <Ingrdnts>  FALSE 2022-03-26
#> 13 Sun   Lunch            18 Normandy Pork & Cider… <Ingrdnts>  FALSE 2022-03-26
#> 14 Sun   Dinner           22 New Potato Tagine      <Ingrdnts>  FALSE 2022-03-26