knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(autorecipes) library(magrittr)
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.
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()
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()
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()
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)
Show/hide
library("sessioninfo") options(width = 120) session_info()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.