kmaLifeIndex: Korea Meteorological Administration, The life weather index.

Description Usage Arguments Details Value Examples

View source: R/kmaLifeIndex.R

Description

kmaLifeIndex function import the life weather index data last 2 days. The function also provide simple visualization using plotly.

Usage

1
2
kmaLifeIndex(key, localeCode = NULL, localeName = NULL, type,
  slow = T, viz = F, verbose = F)

Arguments

key

character value. API key issued from <www.data.go.kr>. no default.

localeCode

numeric value. SiGunGu code which means legal area. one of localeCode or localeName should be inserted.

localeName

character value. SiGunGu name wich means legal area. one of localeCode or localeName should be inserted. It should be Korean.

type

character value. decide the type of index. it should be one of "fp", "st", "hi", "di", "ui", "fb", "ap", "sh" or "possible". see details.

slow

logical value. if TRUE, give sleep inbetween importing. default is TRUE.

viz

logical value. if TRUE, provide simple 2d visualization result. x: date, y: mean index.

verbose

logical value. if TRUE, provide process bar. Default value set as false.

Details

kmaLifeIndex function import eight index value which calculated by Korea Meteorological Administration and related to public's life.
Explanation about "type" as follow.
"fp" = Food poison index. It is povided from Jan to Dec.
"st" = Sensory temperature index. It is povided from Nov to Mar.
"hi" = Heat index. It is povided from Jun to Sep.
"di" = Discomport index. It is povided from Jun to Sep.
"ui" = Ultraviolet index. It is povided from Mar to Nov.
"fb" = Freezing burst index. It is povided from Dec to Feb.
"ap" = Atmospheric dispersion index. It is povided from Nov to May.
"sh" = Sensory heat index. It is povided from May to Sep.
"possible" = All index which affordable now.
See more details about each index from <http://www.weather.go.kr/weather/lifenindustry/life_jisu.jsp#>

Importing data from KMA is so unstable that it is recommended to checking error urls in result.

Value

data.frame and visualization.

Examples

1
2
3
4
5
6
7
8
 # example 1 searching by localeCode
 key <- 'your key issued from data.go.kr'
 data <- kmaLifeIndex(key, localeCode = c(4111100000, 4111156600),
                      type = "fp", slow = TRUE)

 # example 2 searching by localeName
 data <- kmaLifeIndex(key, localeName = c(enc2utf8("수원")),
                      type = "possible", slow = TRUE)

lawine90/datagokR documentation built on Sept. 24, 2020, 9:42 p.m.