Learn R Programming

geostatsp (version 0.7.0)

swissRain: Swiss rainfall data

Description

Data from the SIC-97 project: Spatial Interpolation Comparison.

Usage

data("swissRain")

Arguments

format

swissRain is a SpatialPolygonsDataFrame of the sic.100 data, with data column rain being the rainfall values in millimetres. swissAltitude is a raster of elevation data, and swissLandType is a raster of land cover types.

source

ftp://ftp.geog.uwo.ca/SIC97 and http://srtm.csi.cgiar.org and https://lpdaac.usgs.gov/products/modis_products_table/mcd12q1

Examples

Run this code
data("swissRain")
plot(swissAltitude, main="elevation")
points(swissRain)
plot(swissBorder, add=TRUE)


# land type, a categorical variable
commonValues  = sort(table(values(swissLandType)),decreasing=TRUE)[1:5]
commonValues=commonValues[!names(commonValues)==0]

thelevels = levels(swissLandType)[[1]]$ID
thebreaks = c(-0.5, 0.5+thelevels)
thecol = rep(NA, length(thelevels))
names(thecol) = as.character(thelevels)

thecol[names(commonValues)] = rainbow(length(commonValues))

plot(swissLandType, breaks=thebreaks, col=thecol,legend=FALSE,
	main="land type")
points(swissRain)
plot(swissBorder, add=TRUE)


legend("topleft",fill=thecol[names(commonValues)],
		legend=levels(swissLandType)[[1]][
						match(as.integer(names(commonValues)),
								levels(swissLandType)[[1]]$ID),
						"Category"],
				bty='n'
				)

Run the code above in your browser using DataLab