0
0
R Programmingprogramming~15 mins

List creation in R Programming - Mini Project: Build & Apply

Choose your learning style9 modes available
List creation
📖 Scenario: You are organizing a small party and want to keep track of the guests you invited.
🎯 Goal: Create a list of guest names and display it.
📋 What You'll Learn
Create a list with exactly these guest names: "Alice", "Bob", "Charlie"
Create a variable called guests to hold the list
Print the guests list
💡 Why This Matters
🌍 Real World
Lists are useful to keep track of groups of items, like guest names, shopping lists, or tasks.
💼 Career
Knowing how to create and manage lists is a basic skill for data handling and programming in many jobs.
Progress0 / 4 steps
1
Create the guest list
Create a list called guests with these exact names: "Alice", "Bob", and "Charlie".
R Programming
Need a hint?

Use the list() function to create a list with the names inside.

2
Add a new guest
Create a variable called new_guest and set it to the string "Diana".
R Programming
Need a hint?

Use the assignment operator <- to set new_guest to "Diana".

3
Add the new guest to the list
Add the new_guest to the end of the guests list using the append() function and update guests with the result.
R Programming
Need a hint?

Use append(guests, new_guest) to add the new guest to the list.

4
Display the guest list
Print the guests list to show all guest names.
R Programming
Need a hint?

Use the print() function to display the list.