Learn R Programming

govStatJPN (version 0.1)

get.stat.data: Object to Get Statistical Data of a Specified Survey.

Description

This function purposes to get a data of a survey the defined with stat id.

Usage

get.stat.data(app.id, param, stat.id)

Arguments

app.id
Your application ID. Using all functions contained govStatJPN package, this ID is required. Registration page is https://statdb.nstac.go.jp/apiuser/php/index.php?action=provisional Login page is https://statdb.nstac.go.jp/apiuser/php/index.php?action=login After logging in, you are able to issue your application ID.
param
You can set the list of survey years and language as a list object like list(limit=100, lang="J"). The default value of limit is 10. When you need data set in English. Define lang="E" instead of lang="J". Although setting other parameters is allowed in the API, the parameters that can be used in this function is limited into these two types. The number of parameters can be set in this function will be extended in the future.
stat.id
Required. This is an id in retuned values of get.stat.list.

Value

value
This is the data of the specified survey.
note
This is the note of the specified survey.

Details

This function is based on section 3.4 at the published pdf file (http://statdb.nstac.go.jp/wp/wp-content/uploads/2013/06/API-spec.pdf).

References

http://statdb.nstac.go.jp/ http://statdb.nstac.go.jp/wp/wp-content/uploads/2013/06/API-spec.pdf

See Also

get.stat.list, get.meta.info

Examples

Run this code
# stat.list <- get.stat.list(app.id, list(surveyYears=2007, lang='J'))
# stat.data <- get.stat.data(app.id, list(limit=100),stat.list$id[1])
# show data of the survey
# stat.data$value
# summation of data
# sum(stat.data$value$value)
# mean of data
# mean(stat.data$value$value)
# standard deviation of data
# sd(stat.data$value$value)

# get histogram
# hist(stat.data$value$value, breaks=25)

Run the code above in your browser using DataLab