I would like to use the concept of macro variable from SAS in r but cannot seem to find the right code. It would normally look like this in SAS where I change the name once and it replicates many places.
%LET CITY=NewYork;
Query_&NAME_V01 <- &NAME[,1:3]
Query_&NAME_V01 <- &NAME[1:10,]
I tried using the quote
and noquote
function but I always end up with the this error message: target of assignment expands to non-language object
.