Description Usage Arguments Details Value Examples
View source: R/kmaHealthIndex.R
kmaLifeIndex function import the health index data last 2 days. The function also provide simple visualization using plotly.
1 2 | kmaHealthIndex(key, localeCode = NULL, localeName = NULL, type,
slow = T, viz = F, verbose = F)
|
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 "Asthma", "Brain", "Skin", "FlowerWoody", "FlowerPine", "FlowerWeeds", "Infl" 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. |
kmaLifeIndex function import eight index value which calculated by Korea Meteorological Administration and related to public's life.
Explanation about "type" as follow.
"Asthma" = Possibility index of asthma or lung disease. It is povided the whole year.
"Brain" = Possibility index of stroke. It is povided the whole year.
"Skin" = Possibility index of skin disease. It is povided the whole year.
"FlowerWoody" = Risk index of oak tree's pollen. It is povided from Apr to May.
"FlowerPine" = Risk index of pine tree's pollen. It is povided from Apr to May.
"FlowerWeeds" = Risk index of weed's pollen. It is povided from Sep to Oct.
"Infl" = Possibility index of influenza. It is povided from Sep to Apr.
"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.
data.frame and visualization.
1 2 3 4 5 6 7 | # example 1 searching by localeCode
key <- 'your key issued from data.go.kr'
data <- kmaHealthIndex(key, localeCode = c(4111100000, 4111156600),
type = "Asthma", slow = TRUE)
# example 2 searching by localeName
data <- kmaHealthIndex(key, localeName = c(enc2utf8("수원")), type = "possible", slow = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.