Package 'kgc'

Title: Koeppen-Geiger Climatic Zones
Description: Aids in identifying the Koeppen-Geiger (KG) climatic zone for a given location. The Koeppen-Geiger climate zones were first published in 1884, as a system to classify regions of the earth by their relative heat and humidity through the year, for the benefit of human health, plant and agriculture and other human activity [1]. This climate zone classification system, applicable to all of the earths surface, has continued to be developed by scientists up to the present day. Recently one of use (FZ) has published updated, higher accuracy KG climate zone definitions [2]. In this package we use these updated high-resolution maps as the data source [3]. We provide functions that return the KG climate zone for a given longitude and lattitude, or for a given United States zip code. In addition the CZUncertainty() function will check climate zones nearby to check if the given location is near a climate zone boundary. In addition an interactive shiny app is provided to define the KG climate zone for a given longitude and lattitude, or United States zip code. Digital data, as well as animated maps, showing the shift of the climate zones are provided on the following website <http://koeppen-geiger.vu-wien.ac.at>. This work was supported by the DOE-EERE SunShot award DE-EE-0007140. [1] W. Koeppen, (2011) <doi:10.1127/0941-2948/2011/105>. [2] F. Rubel and M. Kottek, (2010) <doi:10.1127/0941-2948/2010/0430>. [3] F. Rubel, K. Brugger, K. Haslinger, and I. Auer, (2016) <doi:10.1127/metz/2016/0816>.
Authors: Chelsey Bryant [aut, cre] (0000-0003-3603-4854), Nicholas R. Wheeler [aut] (0000-0003-2248-8919), Franz Rubel [aut] (0000-0002-0048-7379), Roger H. French [aut] (0000-0002-6162-0532)
Maintainer: Chelsey Bryant <[email protected]>
License: BSD_2_clause + file LICENSE
Version: 1.0.0.2
Built: 2025-02-13 05:15:15 UTC
Source: https://github.com/cran/kgc

Help Index


Koppen-Geiger Climate Zones reference table.

Description

A data frame containing the Koppen Geiger climate classification for areas.

Usage

climatezones

Format

A data frame with 92416 rows and 3 variables:

Lat

Latitude, numeric

Lon

Longitude, numeric

Cls

Climate Zone, factor with 30 levels

Source

http://koeppen-geiger.vu-wien.ac.at/present.htm


CZUncertainty

Description

This function will return the uncertainty associated with the predicted climate zone along with other potential climate zones.

Usage

CZUncertainty(data)

Arguments

data

The co-ordinates for the location you are trying to predict the climate zone of.

Value

The uncertainty associated with the located climate zone along with other potential climate zones.

Examples

data<- data.frame(Site = c("GC","UFS","NEG"),
  Longitude = c(-15.42,10.98,34.78),
  Latitude = c(27.82,47.42,30.86))
data <- data.frame(data,
  rndCoord.lon = RoundCoordinates(data$Longitude),
  rndCoord.lat = RoundCoordinates(data$Latitude))
data <- data.frame(data,ClimateZ=LookupCZ(data))
data <- data.frame(data, CZUncertainty(data))

genCoords

Description

This function will generate a list of coordinates for the 'fine' resolution climate zone map data, stored in 'kgz.rda'.

Usage

genCoords(latlong = "lat", full = FALSE, latdim = 6480, londim = 12960)

Arguments

latlong

Whether a vector of latitude values, or longitude values, is being created.

full

Specify whether to generate a full list of all coords in the full image, or just one row/column (default FALSE, means just one row/column).

latdim

The number of pixels in the image in the latitude dimension (y)

londim

The number of pixels in the image in the longitude dimension (x)

Value

A vector of latitude or longitude coordinate values (default for a map 12960x 6480y).

Examples

ccoords <- genCoords(latlong='lon',full='true')

getZone

Description

This function will return the character code of a given climate zone corresponding to a numeric value (factor levels of the fine resolution data).

Usage

getZone(num)

Arguments

num

The numeric code describing a climate zone.

Value

A string describing the climate zone as a character code.

Examples

ccz <- getZone(16)

Koppen Geiger climates for selected cities reference table.

Description

A data frame containing the reported climate zones and longitude and latitude for selected example cities worldwide.

Usage

kgcities

Format

A data frame with 88 rows and 5 variables:

loc

location, character

rczd

reported climate zone description, character

rcz

reported climate zone, character

lon

longitude, numeric

lat

latitude, numeric

Source

http://www.wikipedia.org


High resolution (100s) Koppen Geiger climate zones.

Description

A vector containing all points of a high resolution climate zone map.

Usage

kmz

Format

A vector of length 83980800 (ydim=6480,xdim=12960, row-wise), with 32 factor levels representing 31 koppen-geiger climate zones and 'ocean'.

Source

Rubel, F., Brugger, K., Haslinger, K., Auer, I., 2016. The climate of the European Alps: Shift of very high resolution Köppen-Geiger climate zones 1800–2100. Meteorologische Zeitschrift. doi:10.1127/metz/2016/0816 http://koeppen-geiger.vu-wien.ac.at/


LookupCZ

Description

This function will return the climate zone for the co-ordinates provided.

Usage

LookupCZ(data, res = "course", rc = FALSE)

Arguments

data

The co-ordinates for the location you are trying to predict the climate zone of (format is three column dataframe, first column site IDs, second column longitude values, third column latitude values).

res

Specify the resolution as a string - 'course' for lower resolution (default, 0.5 degrees), 'fine' for higher resolution (100s).

rc

Specify whether to generate the rounded coordinate columns in the input dataframe, default is FALSE.

Value

The climate zone for the co-ordinates provided.

Examples

data <- data.frame(Site = c("GC","UFS","NEG"),
  Longitude = c(-15.42,10.98,34.78),
  Latitude = c(27.82,47.42,30.86))
data <- data.frame(data,
  rndCoord.lon = RoundCoordinates(data$Longitude),
  rndCoord.lat = RoundCoordinates(data$Latitude))
data <- data.frame(data,ClimateZ=LookupCZ(data))

RoundCoordinates

Description

This function will round the inputed value to a co-ordinate present in the KG Climate Zone look up table.

Usage

RoundCoordinates(number, res = "course", latlong = "lat")

Arguments

number

The value to round

res

Specify the resolution as a string - 'course' for lower resolution (default, 0.5 degrees), 'fine' for higher resolution (100s).

latlong

Whether the number is a latitude value ('lat', default), or longitude value ('lon') (this parameter is only used if res='fine').

Value

The inputed number, rounded to a value ending in either .25 or .75 (course), or to nearest 'fine' (100s) resolution grid point.

Examples

RoundCoordinates(10.98)
RoundCoordinates(10.98,res='fine',latlong='lon')

RunExample

Description

This function will run the shiny app found in this package.

Usage

RunExample()

Value

launches the shiny app created for the package.

Examples

## Not run: 
kgc::RunExample()

## End(Not run)

TranslateZipCode

Description

This function will return the data frame with the longitude and latitude of the zip codes

Usage

TranslateZipCode(number)

Arguments

number

A dataframe that contains zip codes in a column labeled 'zip'

Value

The original data frame, with two additional columns for the corresponding latitude and longitude

Examples

example <- data.frame("zip" = c(44106,638, 1106))
TranslateZipCode(example)

Zip Code reference table.

Description

A data frame containing the longitude and latitude for zip codes.

Usage

zipcodes

Format

A data frame with 33144 rows and 3 variables:

zip

zip code, numeric

lat

latitude, numic

long

long, numeric

Source

http://www.census.gov/geo/maps-data/data/gazetteer2016.html