| EastAuClimate {latticeExtra} | R Documentation |
A set of climate statistics for 16 coastal locations along Eastern Australia. These sites were chosen to be approximately equally spaced to cover the whole eastern coast of Australia. For each site, climate statistics were calculated for the standard 30-year period 1971-2000. Only sites with nearly-complete data were chosen.
data(EastAuClimate)
A data frame with the following 10 variables and 5 items of metadata for each of 16 sites.
SummerMaxTempSummerMinTempWinterMaxTempWinterMinTempSummerRainWinterRainMeanAnnRainRainDaysClearDaysCloudyDaysIDLatitudeLongitudeElevationStateThe row names of the data frame give the location names. Note: these are not the official names of the climate stations.
Sites were chosen by hand from maps on the Bureau of Meteorology website. The data were extracted manually from web pages under http://www.bom.gov.au/climate/averages/ and processed to extract a subset of statistics. - by Felix Andrews
Bureau of Meteorology, Commonwealth of Australia. Product IDCJCM0026 Prepared at Wed 31 Dec 2008.
Definitions of statistics adapted from http://www.bom.gov.au/climate/cdo/about/about-stats.shtml
EastAuClimate
datasets
data(EastAuClimate)
## Compare the climates of state capital cities
EastAuClimate[c("Hobart", "Melbourne", "Sydney", "Brisbane"),]
## A function to plot maps (a Lattice version of maps::map)
lmap <-
function(database = "world", regions = ".", exact = FALSE,
boundary = TRUE, interior = TRUE, projection = "",
parameters = NULL, orientation = NULL,
aspect = "iso", type = "l",
par.settings = list(axis.line = list(col = "transparent")),
xlab = NULL, ylab = NULL, ...)
{
theMap <- map(database, regions, exact = exact,
boundary = boundary, interior = interior,
projection = projection, parameters = parameters,
orientation = orientation, plot = FALSE)
xyplot(y ~ x, theMap, type = type, aspect = aspect,
par.settings = par.settings, xlab = xlab, ylab = ylab,
default.scales = list(draw = FALSE), ...)
}
## Plot the sites on a map of Australia
if (require("maps")) {
lmap(regions = c("Australia", "Australia:Tasmania"),
exact = TRUE, xlim = c(130, 170),
panel = function(...) {
panel.xyplot(...)
with(EastAuClimate, {
panel.points(Longitude, Latitude, pch = 16)
txt <- row.names(EastAuClimate)
i <- c(3, 4)
panel.text(Longitude[ i], Latitude[ i], txt[ i], pos = 2)
panel.text(Longitude[-i], Latitude[-i], txt[-i], pos = 4)
})
})
}
## Average daily maximum temperature in July (Winter).
xyplot(WinterMaxTemp ~ Latitude, EastAuClimate, aspect = "xy",
type = c("p", "a"), ylab = "Temperature (degrees C)")
## (Make a factor with levels in order - by coastal location)
siteNames <- factor(row.names(EastAuClimate),
levels = row.names(EastAuClimate))
## Plot temperature ranges (as bars), color-coded by RainDays
segplot(siteNames ~ WinterMinTemp + SummerMaxTemp, EastAuClimate,
level = RainDays, sub = "Color scale: number of rainy days per year",
main = paste("Typical temperature range and wetness",
"of coastal Australian cities", sep = "\n"))
## Show Winter and Summer temperature ranges separately
segplot(Latitude ~ WinterMinTemp + SummerMaxTemp, EastAuClimate,
main = "Average daily temperature ranges \n of coastal Australian sites",
ylab = "Latitude", xlab = "Temperature (degrees C)",
par.settings = simpleTheme(lwd = 3, alpha = 0.5),
key = list(text = list(c("July (Winter)", "February (Summer)")),
lines = list(col = c("blue", "red"))),
panel = function(x, y, z, ..., col) {
with(EastAuClimate, {
panel.segplot(WinterMinTemp, WinterMaxTemp, z, ..., col = "blue")
panel.segplot(SummerMinTemp, SummerMaxTemp, z, ..., col = "red")
})
})
## Northern sites have Summer-dominated rainfall;
## Southern sites have Winter-dominated rainfall.
xyplot(SummerRain + WinterRain ~ Latitude, EastAuClimate,
type = c("p", "a"), auto.key = list(lines = TRUE),
ylab = "Rainfall (mm / month)")
## Clear days are most frequent in the mid latitudes.
xyplot(RainDays + CloudyDays + ClearDays ~ Latitude, EastAuClimate,
type = c("p", "a"), auto.key = list(lines = TRUE),
ylab = "Days per year")
R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(latticeExtra)
> png(filename="images/EastAuClimate_%03d.png" ,width=480, height=480)
> ### Name: EastAuClimate
> ### Title: Climate of the East Coast of Australia
> ### Aliases: EastAuClimate
> ### Keywords: datasets
>
> ### ** Examples
>
> data(EastAuClimate)
>
> ## Compare the climates of state capital cities
> EastAuClimate[c("Hobart", "Melbourne", "Sydney", "Brisbane"),]
SummerMaxTemp SummerMinTemp WinterMaxTemp WinterMinTemp SummerRain
Hobart 22.0 12.7 12.2 4.7 28.1
Melbourne 26.5 15.8 13.9 6.8 32.3
Sydney 26.7 19.3 17.0 7.4 80.6
Brisbane 28.8 20.9 20.6 9.5 107.5
WinterRain MeanAnnRain RainDays ClearDays CloudyDays ID Latitude
Hobart 44.1 576.4 90.8 41.1 177.1 94029 -42.89
Melbourne 46.8 654.4 99.2 48.9 178.0 86071 -37.81
Sydney 54.5 1129.2 95.8 104.1 126.3 66037 -33.94
Brisbane 40.0 1192.1 89.4 123.5 105.9 40223 -27.42
Longitude Elevation State
Hobart 147.33 51 TAS
Melbourne 144.97 31 VIC
Sydney 151.17 6 NSW
Brisbane 153.11 4 QLD
>
> ## A function to plot maps (a Lattice version of maps::map)
> lmap <-
+ function(database = "world", regions = ".", exact = FALSE,
+ boundary = TRUE, interior = TRUE, projection = "",
+ parameters = NULL, orientation = NULL,
+ aspect = "iso", type = "l",
+ par.settings = list(axis.line = list(col = "transparent")),
+ xlab = NULL, ylab = NULL, ...)
+ {
+ theMap <- map(database, regions, exact = exact,
+ boundary = boundary, interior = interior,
+ projection = projection, parameters = parameters,
+ orientation = orientation, plot = FALSE)
+ xyplot(y ~ x, theMap, type = type, aspect = aspect,
+ par.settings = par.settings, xlab = xlab, ylab = ylab,
+ default.scales = list(draw = FALSE), ...)
+ }
>
> ## Plot the sites on a map of Australia
> if (require("maps")) {
+ lmap(regions = c("Australia", "Australia:Tasmania"),
+ exact = TRUE, xlim = c(130, 170),
+ panel = function(...) {
+ panel.xyplot(...)
+ with(EastAuClimate, {
+ panel.points(Longitude, Latitude, pch = 16)
+ txt <- row.names(EastAuClimate)
+ i <- c(3, 4)
+ panel.text(Longitude[ i], Latitude[ i], txt[ i], pos = 2)
+ panel.text(Longitude[-i], Latitude[-i], txt[-i], pos = 4)
+ })
+ })
+ }
>
> ## Average daily maximum temperature in July (Winter).
> xyplot(WinterMaxTemp ~ Latitude, EastAuClimate, aspect = "xy",
+ type = c("p", "a"), ylab = "Temperature (degrees C)")
>
> ## (Make a factor with levels in order - by coastal location)
> siteNames <- factor(row.names(EastAuClimate),
+ levels = row.names(EastAuClimate))
> ## Plot temperature ranges (as bars), color-coded by RainDays
> segplot(siteNames ~ WinterMinTemp + SummerMaxTemp, EastAuClimate,
+ level = RainDays, sub = "Color scale: number of rainy days per year",
+ main = paste("Typical temperature range and wetness",
+ "of coastal Australian cities", sep = "\n"))
>
> ## Show Winter and Summer temperature ranges separately
> segplot(Latitude ~ WinterMinTemp + SummerMaxTemp, EastAuClimate,
+ main = "Average daily temperature ranges \n of coastal Australian sites",
+ ylab = "Latitude", xlab = "Temperature (degrees C)",
+ par.settings = simpleTheme(lwd = 3, alpha = 0.5),
+ key = list(text = list(c("July (Winter)", "February (Summer)")),
+ lines = list(col = c("blue", "red"))),
+ panel = function(x, y, z, ..., col) {
+ with(EastAuClimate, {
+ panel.segplot(WinterMinTemp, WinterMaxTemp, z, ..., col = "blue")
+ panel.segplot(SummerMinTemp, SummerMaxTemp, z, ..., col = "red")
+ })
+ })
>
> ## Northern sites have Summer-dominated rainfall;
> ## Southern sites have Winter-dominated rainfall.
> xyplot(SummerRain + WinterRain ~ Latitude, EastAuClimate,
+ type = c("p", "a"), auto.key = list(lines = TRUE),
+ ylab = "Rainfall (mm / month)")
>
> ## Clear days are most frequent in the mid latitudes.
> xyplot(RainDays + CloudyDays + ClearDays ~ Latitude, EastAuClimate,
+ type = c("p", "a"), auto.key = list(lines = TRUE),
+ ylab = "Days per year")
>
>
>
> dev.off()
null device
1
>