Function: get_recipes
get_recipes.Rmd
Overview
The get_recipes
function in the
Mealsuggestor
package allows users to filter recipes based
on various criteria, including ingredients, cuisine, and diet. This
function is ideal for users who want to find recipes that match specific
dietary needs or culinary preferences.
Parameters
-
data
: A data frame containing the recipes. -
ingredients
: A vector of ingredients to filter the recipes. IfNULL
, this filter is not applied. -
cuisine
: A string specifying the cuisine type. IfNULL
, this filter is not applied. -
diet
: A string specifying the diet type (e.g., Gluten-Free, Vegan). IfNULL
, this filter is not applied.
Returns
This function returns a data frame containing recipes filtered based on the specified criteria.
Example Usage
The following example shows how to use the get_recipes
function to filter recipes by ingredients, cuisine, and diet:
library(Mealsuggestor)
filtered_recipes <- get_recipes(recipes,
ingredients = c("tomato", "chicken"),
cuisine = "Italian",
diet = "Gluten Free")
# Display the filtered recipes
print(filtered_recipes)