Numeric and character vectors
📖 Scenario: You are organizing a small party and want to keep track of the number of guests and their favorite drinks.
🎯 Goal: Create numeric and character vectors in R to store the number of guests and their favorite drinks, then display the information.
📋 What You'll Learn
Create a numeric vector called
guest_counts with the exact values 5, 3, 7Create a character vector called
favorite_drinks with the exact values "Tea", "Coffee", "Juice"Create a variable called
total_guests that sums all values in guest_countsPrint the
total_guests valuePrint the
favorite_drinks vector💡 Why This Matters
🌍 Real World
Keeping track of guest counts and preferences helps in planning events and ordering the right amount of food and drinks.
💼 Career
Data analysts and event planners often work with numeric and character data to summarize and report information clearly.
Progress0 / 4 steps