Not entirely sure, but try establishing shop$ before it's used to define R$. As in, put "Shop$=" before R$=.