Comparison Operators in R
📖 Scenario: You are working in a small shop and want to check which products are priced above a certain amount to decide which ones to promote.
🎯 Goal: Build a simple R program that uses comparison operators to find products priced above a threshold.
📋 What You'll Learn
Create a named numeric vector called
products with exact product names and pricesCreate a numeric variable called
threshold with the value 50Use a comparison operator to create a logical vector called
expensive_products that is TRUE for products priced above thresholdPrint the
expensive_products vector💡 Why This Matters
🌍 Real World
Shops often need to filter products by price to decide which items to promote or discount.
💼 Career
Understanding comparison operators is essential for data filtering and decision making in data analysis and programming jobs.
Progress0 / 4 steps