Changing the plot titles of a for-loop plot

11 Views Asked by At

Im new to for looping and i wrote this code:

par(mfrow = c(2,2))

loop.vector <- c(1:4)

for (i in 1:4) {
  col.pos <- iris[,i]
  hist(col.pos,
       main = paste("Plot", i),
       xlab = "Length in [cm]")
}

Now instead of having the titels Plot 1, Plot 2,... id like to give individual names to each plot.

How can i achieve this?

enter image description here

0

There are 0 best solutions below