if (FALSE) {
## If some of the next examples do not work, try using a different
## date. Check availability for each service with the links included in
## the references section.
testDay <- Sys.Date() - 1
## temperature (Kelvin) forecast from meteogalicia
tempK <- getPoint(c(0, 40), vars = 'temp', day = testDay)
## Cell does not coincide exactly with request
attr(tempK, 'lat')
attr(tempK, 'lon')
## Units conversion
tempC <- tempK - 273
library(lattice)
## Beware: the x-axis labels display time using your local timezone.
Sys.timezone()
## Use Sys.setenv(TZ = 'UTC') to produce graphics with the timezone
## of the objects provided by meteoForecast.
xyplot(tempC)
## Multiple variables
vars <- getPoint(c(0, 40), vars = c('swflx', 'temp'), day = testDay)
xyplot(vars)
## Vertical coordinates
tempK1000 <- getPoint(c(0,40),
vars = "Temperature_surface",
day = testDay,
service ="gfs", vertical = 1000)
## Time sequence
radDays <- getPointDays(c(0, 40),
start = testDay - 3,
end = testDay)
xyplot(radDays)
## Variability between runs
radRuns <- getPointRuns(c(0, 40),
start = testDay - 3,
end = testDay)
xyplot(radRuns, superpose = TRUE)
## variability around the average
radAv <- rowMeans(radRuns)
radVar <- sweep(radRuns, 1, radAv)
xyplot(radVar, superpose = TRUE)
}
Run the code above in your browser using DataLab