Why data frames are central to R
📖 Scenario: Imagine you are a small business owner who wants to keep track of your sales data. You have information about the products sold, the quantity, and the price. You want to organize this data so you can easily analyze it and make decisions.
🎯 Goal: You will create a simple data frame in R to store sales data, add a helper variable for a sales threshold, filter the data based on this threshold, and then display the filtered results. This will show why data frames are central to R for handling tabular data.
📋 What You'll Learn
Create a data frame called
sales_data with columns Product, Quantity, and Price using exact valuesCreate a variable called
min_sales with the value 50Use a subset operation to create a new data frame
filtered_sales with rows where Quantity is greater than min_salesPrint the
filtered_sales data frame💡 Why This Matters
🌍 Real World
Data frames help organize and analyze data like sales, customer info, or survey results in a clear table format.
💼 Career
Many jobs in data analysis, statistics, and research use R data frames to handle and explore data efficiently.
Progress0 / 4 steps