knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(autorecipes)
library(magrittr)

Background

As an unadventurous, by-the-recipe cook, I had accumulated a set of ~25 go-to meals that were chosen from each week. Over time, this selection became repetitive, which motivated the development of autorecipes and autogroceries. This package, autorecipes, automates the task of creating a weekly meal plan and corresponding shopping list of ingredients. autogroceries automates the ordering of the ingredients.


Basic usage

Example recipes

autorecipes defines a RecipeBook-class that stores the names and ingredients of recipes. autorecipes also includes a set of r length(recipebook_example) example recipes in autorecipes::recipebook_example.

recipebook <- recipebook_example

class(recipebook)

recipes(recipebook) %>% head()


Set your favourite recipes

autorecipes allows users to set their favorite recipes using add_favourites() and rm_favourites(). This information can be used to determine the subset of recipes that will enter your meal plan.

# set the first 3 recipes as favourites
recipebook <- add_favourites(recipebook, 1:3)

recipes(recipebook) %>% head()


Create a meal plan

autorecipes allows you to create meal plan from your RecipeBook-class object. For this, you can set the days and meals you would like to plan for and also whether you only want to consider your favourite recipes.

create_meal_plan() can either select recipes randomly (method = "random") or take into account when you have last chosen a recipe for a previous meal plan (method = "auto").

recipebook <- create_meal_plan(
  recipebook,
  which_days = c("Wed", "Thurs", "Fri", "Sat", "Sun"), 
  which_meals = "Dinner",
  method = "auto",
  fav_only = TRUE
)

meal_plan(recipebook)


Create shopping list

create_shopping_list() aggregates all of the ingredients required to make your meal plan into a shopping list. The filter_method determines whether to remove store cupboard ingredients (e.g. salt) that you are unlikely to want to order every week.

The outputted shopping list is designed to then be inputted into autogroceries.

recipebook <- create_shopping_list(recipebook, filter_method = "minimal")

shopping_list(recipebook)


Session info

Show/hide

library("sessioninfo")
options(width = 120)
session_info()



dzhang32/autorecipes documentation built on April 15, 2022, 3:29 a.m.