# Pettitt range test for Turin 1961-2003
PettittTurin<- PettittTest(yearly.average.temperature.Turin.Milan[,2])
# Pettitt range test for Milan 1961-2003
PettittMilan<- PettittTest(yearly.average.temperature.Turin.Milan[,3])
plot(1961:2003,PettittTurin,type='l',col='cyan',ylim=c(-400,0),
main='Pettitt range test 1961-2003',xlab='Years',ylab='Pettitt value')
par(new=TRUE)
plot(1961:2003,PettittMilan,type='l',col='magenta',ylim=c(-400,0),xlab='',ylab='')
legend("top",c('Turin','Milan'),text.col=c('cyan','magenta'))
Run the code above in your browser using DataLab