access_API: API interface

View source: R/access_api.R

access_APIR Documentation

API interface

Description

Given a local Id of a correspondence table or classification, gets the data and transforms it into a data.frame. For internal use of the package.

Usage

access_API(
  localId = NULL,
  content = "data",
  classification_service = NULL,
  lang = "fi"
)

Arguments

localId

character, local ID of the correspondence table or classification

content

character, "data" or "url" determines the content of query

classification_service

character, "correspondenceTable" or "classifications". Determines the classification service used.

lang

"fi", "en", or "sv", desired language. Defaults to "fi".

Details

Currently supported classification services are 'classifications' and 'correspondenceTables'. For more information on classification services, see https://www.stat.fi/en/luokitukset/info/.

Value

data.frame either the correspondence table or its url depending on argument content.

Examples


  localId <- "kunta_1_20200101%23seutukunta_1_20200101"
  df <- access_API(localId, content = "data")
  access_API(localId, content = "url")


pttry/statficlassifications documentation built on Jan. 17, 2024, 4:36 p.m.