小编Jay*_*Bee的帖子

为什么我不能为 str_detect 提供列名参数?

我有这个玩具数据df

structure(list(Product_Name = c("Delicious Chips", "Creamy Tomato Soup", 
"Cheesy Macaroni", "Savory Meatballs", "Crispy Chicken Tenders"
), Ingredients = c("Potato Slices | Vegetable Oil | Salt | Seasoning Blend", 
"Tomatoes | Water | Cream | Onions | Salt | Spices", "Macaroni | Cheese Sauce | Milk | Butter | Salt | Pepper", 
"Ground Meat | Breadcrumbs | Onions | Garlic | Spices", "Chicken Tenders | Breading Mix | Vegetable Oil | Salt | Pepper"
)), row.names = c(NA, 5L), …
Run Code Online (Sandbox Code Playgroud)

r stringr

5
推荐指数
1
解决办法
347
查看次数

如何使用正则表达式或字符串操作分割复杂的字符串?

我有一份成分清单如下:

Ingredients <- "Starch (Corn | Potato | Wheat) | Vegetables (27%) [Pea (23%) (Flakes | Pieces) | Carrot Pieces | Onion Powder | Spinach Powder] | Croutons (10%) (Wheat Flour | Vegetable Oil | Salt | Yeast) | Maltodextrin | Natural Flavours (Contain Milk and Soybeans) | Creamer [Contains Milk | Mineral Salts (339 or 340 | 450 or 451)] | Salt | Mineral Salt (Potassium Chloride) | Sugar | Flavour Enhancer (621) | Vegetable Oil | Bacon Powder …
Run Code Online (Sandbox Code Playgroud)

regex string split r

3
推荐指数
2
解决办法
121
查看次数

标签 统计

r ×2

regex ×1

split ×1

string ×1

stringr ×1