Changes between Version 21 and Version 22 of udg/ecoms/RPackage/examples


Ignore:
Timestamp:
May 20, 2013 6:47:55 PM (8 years ago)
Author:
juaco
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • udg/ecoms/RPackage/examples

    v21 v22  
    215215[[Image(stations.png)]]
    216216
    217 In this particular example we are interested in the mean surface temperature from the cities of Santander and Madrid. The station codes are
     217In this particular example we are interested in the mean surface temperature from the cities of Santander and Madrid in January. The station codes are
    218218''"000230"'' and ''"001392"'' for Madrid and Santander respectively. We will select the period 1990-1999.
    219219
     
    234234  .. ..$ : NULL
    235235  .. ..$ : chr [1:2] "000230" "001392"
    236 > plot(stationData$Dates, stationData$Data[ ,1], col = "red", type = "l")
    237 > lines(stationData$Dates, stationData$Data[ ,2], col = "green")
    238 > legend("topright", c("Madrid","Santander"), col = c("red","green"), lty=1, bg = "white")
     236> ylimits <- c(floor(min(stationData$Data)) * .1, ceiling(max(stationData$Data) * .1))
     237> plot(stationData$Data[ ,1], ty='n', ylim = ylimits, axes=FALSE, ylab="degC", xlab="Year")
     238> axis(1,at = seq(1,31*11,31), labels=c(1990:1999,""))
     239> axis(2, ylim=ylimits)
     240> abline(v=seq(1,31*10,31), lty=2, col = "grey30")
     241> for (i in 1:ncol(stationData$Data)) {
     242+      lines(stationData$Data[ ,i] * .1, col=i)
     243+ }
     244> city.names = c("Madrid","Santander")
     245> legend("topright", paste(city.names, stationData$StationID), lty=1, col=1:2, bty="n")
     246> title(main = "Mean surface Temperature January - Observations")
    239247
    240248}}}