So I have a function where I create scatter plots for a list of variables. I would like to title those scatter plots and do that in the same function. How may I reference a variable name when I iterate through a list? Is there something like plot(sectors[[i]],l, xlab= name(sectors[[i]])...
plot_correlation_index <- function(a,b,c,d,e,f,g,h,i,j,k,l){
sectors <- list(a,b,c,d,e,f,g,h,i,j,k)
for(i in 1:length(sectors)) {plot(sectors[[i]],l)}
}