Package 'japanstat'

Title: Tools for Easy Use of 'e-Stat' API
Description: Provides tools for using the API of 'e-Stat' (<https://www.e-stat.go.jp/>), a portal site for Japanese government statistics. Includes functions for automatic query generation, data collection and formatting.
Authors: Mizuki Uchida [aut, cre]
Maintainer: Mizuki Uchida <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-08-22 03:01:36 UTC
Source: https://github.com/cran/japanstat

Help Index


Get meta-information of 'e-Stat' data

Description

The estat gets the meta-information of a statistical table by using getMetaInfo of the 'e-Stat' API, and returns an estat object that allows editing of meta-information by filter and select.

Usage

estat(statsDataId, appId = NULL, lang = NULL, query = NULL)

Arguments

statsDataId

A statistical data ID on 'e-Stat'.

appId

An 'appId' of 'e-Stat' API.

lang

A language, Japanese ("J") or English ("E").

query

A list of additional queries.

Value

A estat object.

Examples

## Not run: 
estat("https://www.e-stat.go.jp/dbview?sid=0003433219")

## End(Not run)

Determine which estat object key to edit.

Description

Determine which estat object key to edit.

Usage

estat_activate(x, pattern, new_name = NULL)

estat_activate_tab(x, new_name = NULL)

estat_activate_time(x, new_name = NULL)

estat_activate_area(x, new_name = NULL)

estat_activate_cat(x, n, new_name = NULL)

Arguments

x

A estat object.

pattern

Pattern to look for.

new_name

New column name.

n

A category number.

Value

The estat object which the selected key is active.

Examples

estat_activate_tab(estat_census_2020)
estat_activate_cat(estat_census_2020, 1)
estat_activate_area(estat_census_2020)
estat_activate_time(estat_census_2020)

Population of the 2020 census

Description

Population of the 2020 census

Usage

estat_census_2020

Format

An object of class estat of length 6.

Source

https://www.e-stat.go.jp/dbview?sid=0003433219


Download 'e-Stat' data

Description

Download 'e-Stat' data

Usage

estat_download(x, value_name = "value", query = NULL)

Arguments

x

A estat object.

value_name

A column name of the value.

query

A list of additional queries.

Value

A tbl of the downloaded data.

Examples

## Not run: 
estat_download(estat_census_2020)

## End(Not run)

Set attributes of 'e-Stat' API

Description

Set attributes of 'e-Stat' API

Usage

estat_set(i, value)

Arguments

i

An attribute name.

value

An attribute value

Value

No output..

Examples

estat_set("estat_limit_downloads", 1e5)
estat_set("estat_limit_items", 1e2)

Set 'appId' of 'e-Stat' API

Description

Set 'appId' of 'e-Stat' API

Usage

estat_set_apikey(appId)

Arguments

appId

An 'appId' of 'e-Stat' API.

Value

No output.

Examples

estat_set_apikey("Your e-Stat appId")

Set language of 'e-Stat' API

Description

Set language of 'e-Stat' API

Usage

estat_set_lang(lang)

Arguments

lang

A language of 'e-Stat' API, Japanese ("J") or English ("E").

Value

No output.

Examples

estat_set_lang("J")

Get table information for 'e-Stat' data

Description

Get table information for 'e-Stat' data

Usage

estat_table_info(x)

Arguments

x

A estat object.

Value

A tbl of the table information.


Tools for easy use of 'e-Stat' API

Description

Provides tools for using the API of 'e-Stat' (<https://www.e-stat.go.jp/>), a portal site for Japanese government statistics. Includes functions for automatic query generation, data collection and formatting.

Author(s)

Maintainer: Mizuki Uchida [email protected]

See Also

Useful links: