In R I was wondering if I could have a dictionary (in a sense like python) where I have a pair (i, j) as the key with a corresponding integer value. I have not
(i, j)
You can do this with a list of vectors.
maps <- lapply(vector('list',5), function(i) integer(0)) maps[[1]][2] <- 1 maps[[1]][3] <- 3 maps[[1]][4] <- 4 maps[[1]][5] <- 3
That said, there's probably a better way to do what you're trying to do, but you haven't given us enough background.