sn_derive_categories: Derive categories based on available information

View source: R/sn_match_categories.R

sn_derive_categoriesR Documentation

Derive categories based on available information

Description

This function attributes a category to a subject first based on manuale categorisation. If there is no match, and Wikidata is available, it checks for the canonisation status and sets "religion" for all saints. Then it attributes categories based on a list of occcupations.

Usage

sn_derive_categories(
  country = NULL,
  gisco_id = NULL,
  street_name = NULL,
  streets_sf = NULL,
  lau_year = 2020,
  include_checked_elsewhere_in_country = FALSE,
  occupation_categories_df = sn_occupation_categories_df,
  canonization_religious_qid = c("Q43115", "Q3464126"),
  language = tidywikidatar::tw_get_language(),
  connection = NULL,
  disconnect_db = TRUE
)

Arguments

country

A two letter country code. See 'unique(sn_lau_by_nuts$country)' for available values.

gisco_id

A characther vector of length one, must correpond to a gisco id. See 'sn_lau_by_nuts' for available values.

street_name

A characther vector of length one, a street name. If not given, returns added data on all streets for given municipality.

include_checked_elsewhere_in_country

Defaults to FALSE. If TRUE, retrieves all streets from the whole country, keeps the most recent, and includes it in the final output if no local match is found or the national match is more recent.

occupation_categories_df

A data frame of matches between occupation (P106) and category

canonization_religious_qid

A vector of QID. All those that have one of these QIDs as canonisation status (P411) will be categorised as "religion".

language

Defaults to language set with 'tw_set_language()'; if not set, "en". Use "all_available" to keep all languages. For available language values, see https://www.wikidata.org/wiki/Help:Wikimedia_language_codes/lists/all

connection

Defaults to NULL. If NULL, and caching is enabled, 'streetnamer' will use a local sqlite database. A custom connection to other databases can be given (see vignette 'caching' for details).

disconnect_db

Defaults to TRUE. If FALSE, leaves the connection open.


giocomai/streetnamer documentation built on Oct. 14, 2023, 6:27 p.m.