adding new key in R dictionary

To add a new key in an R dictionary, follow these steps:

  1. Create a new empty dictionary using the list() function.
  2. Add a new key-value pair to the dictionary using the key in double square brackets and assign the value using the assignment operator <-.
  3. Access the value of the newly added key using the key in double square brackets.

That's it!