getStatsData API

Share:

Description

Get some statistical data via e-Stat API.

Usage

1
2
estat_getStatsData(appId, statsDataId, startPosition = NULL, limit = NULL,
  lang = c("J", "E"), .fetch_all = TRUE, ...)

Arguments

appId

application ID

statsDataId

ID of the statistical dataset

startPosition

Integer. The the first record to get.

limit

Integer. Max number of records to get.

lang

Language of data. "J"(Japanese) or "E"(English).

.fetch_all

Whether to fetch all records when the number of records is larger than 100,000.

...

Other parameters like lvCat01 and cdCat01. See Other parameters section for more details.

Other parameters

For every detailed information, please visit the URL in See Also.

  • lvTab: Level of the meta-information. The format can be X or X-Y, -X and X-.

  • cdTab: Code(s) of the meta-infomation items to select. The format can be a character vector (c("001", "002")) or a chraracter of values and commas ("001,002").

  • cdTabFrom: The code of the first meta-information item to select.

  • cdTabTo: The code of the last meta-information item to select.

  • lvTime: Level of the time to select. The format is the same as lvTab

  • cdTime Time(s) to select. The format is the same way like cdTab

  • cdTimeFrom: The first time to select. The format is the same way like cdTabFrom

  • cdTimeTo: The last time to select. The format is the same way like cdTabTo

  • lvArea: Level of the area to select. The format is the same as lvTab

  • cdArea Code(s) of the Area to select. The format is the same way like cdTab

  • cdAreaFrom: The code of the first area to select. The format is the same way like cdTabFrom

  • cdAreaTo: The code of the last area to select. The format is the same way like cdTabTo

  • lvCat01, cdCat01, cdCat01From, cdCat01To, ...: The same way like above.

See Also

http://www.e-stat.go.jp/api/e-stat-manual2-1/#api_2_3 http://www.e-stat.go.jp/api/e-stat-manual2-1/#api_3_4

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
# fetch all data, which may take time
estat_getStatsData(
  appId = "XXXX",
  statsDataId = "0003065345"
)

# fetch data up to 10 records
estat_getStatsData(
  appId = "XXXX",
  statsDataId = "0003065345",
  limit = 10
)

# fetch data up to 100,000 records (max number of records available at once)
estat_getStatsData(
  appId = "XXXX",
  statsDataId = "0003065345",
  .fetch_all = FALSE
)

# fetch all data in the specifed category
estat_getStatsData(
  appId = "XXXX",
  statsDataId = "0003065345",
  cdCat01 = c("008", "009", "010")
)


## End(Not run)