Pipe chaining operations
📖 Scenario: You work in a small bakery and keep track of daily sales in a list. You want to find out which items sold more than 10 units and then get their names in uppercase to display on a special board.
🎯 Goal: Use pipe chaining operations to filter items with sales greater than 10 and convert their names to uppercase.
📋 What You'll Learn
Create a named vector called
sales with exact entries: Bread = 15, Cookies = 8, Cake = 12, Pie = 5Create a variable called
threshold and set it to 10Use pipe chaining with
%>% to filter sales for items with sales greater than threshold and then convert the item names to uppercasePrint the final result
💡 Why This Matters
🌍 Real World
Filtering and transforming sales data helps businesses quickly identify top-selling products and display them clearly for customers or staff.
💼 Career
Data analysts and business intelligence professionals often use pipe chaining in R to write clean, readable code for data filtering and transformation.
Progress0 / 4 steps