R Lists

  • A list is a comma seperated collection of various data types
  • The order of elements ina list cannot be changed
  • Use list() function to create a list

Syntax

Creating An Empty List

Empty lists can be created and then elements added to it later.

Adding Elements to a List

Accessing Items in List

The index number of items in a list can be accessed using the index number inside of brackets

length() :Length of a List

append(): Add Items to a List

syntax: append(x, values, after = length(x))

Removing Items From a List

Loop through a list

c(): Combining Lists

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top