Named list elements
📖 Scenario: Imagine you are organizing a small collection of fruits with their quantities. You want to keep track of each fruit by name and how many you have.
🎯 Goal: You will create a named list in R where each fruit name is linked to its quantity. Then you will access and display this information.
📋 What You'll Learn
Create a named list with exact fruit names and quantities
Create a variable to hold the name of a fruit to look up
Use the variable to get the quantity from the named list
Print the quantity of the chosen fruit
💡 Why This Matters
🌍 Real World
Named lists help organize data by labels, like keeping track of items and their counts in a store or kitchen.
💼 Career
Understanding named lists is useful for data analysis, reporting, and programming tasks where you need to label and access data clearly.
Progress0 / 4 steps