Accessing list elements in R by name
TIL: parts of the element name are sufficient
R
Let’s create a list mylist
with two elements, mylist$frequency
and mylist$amplitude
.
If we want to see the value of mylist$frequency
, we can do this:
But we can also do this:
We now add another element to the list called mylist$freestyle
.
Note, that freestyle
also starts with the letters fre
!
Now we can’t do this anymore: