I have a data frame of two columns: key and value and I would like to create a dictionary using the respective row of each column for each element of the dictionary / hash table.
As far as I understand the typical way of using R dictionaries / hash tables is by doing something similar to this.
labels.dic <- c("Id of the item and some other description" = "id")
This works perfectly fine but when I try to do it using the values from the data frame (named lbls in the example) it does not work. Why does this happen?
labels.dic <- c(lbls[1,1]=lbls[1,2])
Error: unexpected '=' in "c(lbls[1,1] ="