Understanding Lists
A list is a flexible data type that, unlike a vector, can store elements of different types in a single object.
Creating List
To create a list, use the list() function and pass the values you want to store as arguments. You can even store a text string, a number, and a logical value together.
Example
1list("Text", 42, TRUE)
The structure of the list output differs from that of a vector, since each element is displayed with its index in double brackets.
Swipe to start coding
- Create a list named
infowith the information on the current chapter and course:'R Introduction',6(section),1(chapter in the section),41(chapter overall). - Output the value of this list.
Løsning
Takk for tilbakemeldingene dine!
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Fantastisk!
Completion rate forbedret til 2.27
Understanding Lists
Sveip for å vise menyen
A list is a flexible data type that, unlike a vector, can store elements of different types in a single object.
Creating List
To create a list, use the list() function and pass the values you want to store as arguments. You can even store a text string, a number, and a logical value together.
Example
1list("Text", 42, TRUE)
The structure of the list output differs from that of a vector, since each element is displayed with its index in double brackets.
Swipe to start coding
- Create a list named
infowith the information on the current chapter and course:'R Introduction',6(section),1(chapter in the section),41(chapter overall). - Output the value of this list.
Løsning
Takk for tilbakemeldingene dine!
single