adding new key in R dictionary
To add a new key in an R dictionary, follow these steps:
- Create a new empty dictionary using the
list()
function. - Add a new key-value pair to the dictionary using the key in double square brackets and assign the value using the assignment operator
<-
. - Access the value of the newly added key using the key in double square brackets.
That's it!