I have a dataframe where the first column is years and consecutive columns are country names with time series data for each country (28). I would like to plot all of them in one go. Here is my code:
par(mfrow=c(4,7))
for (i in DP[,2:29]) {
plot(DP$Year,i,
ylim=range(c(0, 400)),
type="p",col="red", xaxt="n", yaxt="n",
ylab="mortality rate",
xlab="year",
pch=16, main=c(colnames(DP[,2:29])))
axis(side = 1)
axis(side = 2, seq(from=0, to=400, by=25))
}
The plot however shows all the country names for every graph. What shall I do?