Package 'jpstat'

Title: Tools for Easy Use of the 'e-Stat' API
Description: Provides tools to use the 'e-Stat' API (<https://www.e-stat.go.jp/>), the portal site for Japanese government statistics.
Authors: Mizuki Uchida [aut, cre]
Maintainer: Mizuki Uchida <[email protected]>
License: MIT + file LICENSE
Version: 0.5.0
Built: 2026-07-21 05:00:44 UTC
Source: https://github.com/cran/jpstat

Help Index


Collect data from an 'e-Stat' table

Description

collect() downloads the statistical values selected from an estat object with dplyr::filter(), dplyr::select(), and navigatr::rekey(), and returns them as a tidy tibble. Large tables are paginated automatically.

Usage

## S3 method for class 'estat'
collect(x, n = "n", names_sep = "_", query = list(), limit = 100000L, ...)

## S3 method for class 'tbl_estat'
collect(x, ...)

Arguments

x

An estat or tbl_estat object.

n

Name of the column that holds the observed values.

names_sep

Separator used to combine a classification's key (e.g. "area") with its selected columns (e.g. "name") into new column names (e.g. "area_name").

query

A list of additional queries passed to 'e-Stat's getStatsData API.

limit

Maximum number of records requested per page. 'e-Stat' caps this at 100000.

...

Ignored.

Value

A tibble.

Examples

## Not run: 
Sys.setenv(ESTAT_API_KEY = "Your API key")
estat("https://www.e-stat.go.jp/dbview?sid=0003433219") |>
  dplyr::collect()

## End(Not run)

Access '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 dplyr::filter() and dplyr::select().

Usage

estat(
  statsDataId,
  lang = c("J", "E"),
  query = list(),
  path = "rest/3.0/app/json"
)

Arguments

statsDataId

A statistical data ID on 'e-Stat'.

lang

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

query

A list of additional queries.

path

An e-Stat API path.

Value

A estat object.

See Also

https://www.e-stat.go.jp

https://www.e-stat.go.jp/en

Examples

## Not run: 
Sys.setenv(ESTAT_API_KEY = "Your API key")
estat("https://www.e-stat.go.jp/dbview?sid=0003433219")

## End(Not run)

Tools for easy use of 'e-Stat' API

Description

logo

Provides tools to use the 'e-Stat' API (https://www.e-stat.go.jp/), the portal site for Japanese government statistics.

Author(s)

Maintainer: Mizuki Uchida [email protected]

Authors:

See Also

Useful links:


Summarize the table information of an 'e-Stat' table

Description

summary() returns the table-level metadata (title, survey date, publisher, and so on) of an estat object created by estat().

Usage

## S3 method for class 'estat'
summary(object, ...)

## S3 method for class 'tbl_estat'
summary(object, ...)

Arguments

object

An estat or tbl_estat object.

...

Ignored.

Value

A tibble of table information.