Read in a list of ingredients from a character vector
Source:R/RecipeBook-class.R
read_ingredients.Rd
Read in a list of ingredients from a character vector
Arguments
- ingredients
character()
containing ingredient info separated bydelim
. Each element should denote the ingredients coming from a distinct recipe.- delim
character()
that separates each ingredient.
Value
list()
of elements of Ingredients-class
objects.
Examples
read_ingredients(
c(
"butter;6 eggs;1 bag coriander;1 punnet mixed baby tomatoes",
"1 tsp garam masala;1 bag baby spinach;1 lemon;1 chilli"
),
delim = ";"
)
#> [[1]]
#> 1 Butter
#> 6 Eggs
#> 1 bag Coriander
#> 1 punnet Mixed Baby Tomatoes
#>
#> [[2]]
#> 1 tsp Garam Masala
#> 1 bag Baby Spinach
#> 1 Lemon
#> 1 Chilli
#>