Проголосовал за ответ выше. Однако это одно конкретное место, где a для l oop тоже неплохой выбор. Как в:
z <- c("Bronx","Staten","Tribeca")
func <- function(i,z){
filename <- paste0("plot_",i,".png")
png(filename)
plot(1:30,rep(which(i==z),30)) # just getting 3 simple plots to print
dev.off()}
for (i in z) func(i,z)
# You will find the plots as .png files in your working directory
# with "plot_" prepended to each name