variable_exists: Inspect whether a given variable contains more than just...

View source: R/variable_exists.R

variable_existsR Documentation

Inspect whether a given variable contains more than just non-missing or non-zero values for a selected group of countries in the LIS or LWS databases.

Description

Inspect whether a given variable contains more than just non-missing or non-zero values for a selected group of countries in the LIS or LWS databases.

Usage

variable_exists(variable, iso2, lws = FALSE, share = FALSE)

Arguments

variable

A unit-length character vector containing specified LIS/LWS variables.

iso2

A character vector with valid iso2 codes of countries present in LIS/LWS.

lws

A logical value, that guides the tool to search in the LIS or LWS database. The argument is FALSE by default, taking LIS as the database to be investigated if nothing is specified.

share

A logical value indicating whether to output the share of datasets, across the entire time series for each country, where a variable has more than just non-missing or non-zero values, instead of displaying its presence year by year.

Value

A list made of character vectors. If share = TRUE, then a list with a numeric vector.

Examples

variable_exists(variable = "area_c", iso2 = "br")
variable_exists(variable = "basb", iso2 = c("fr", "de", "us", "uk"), lws = TRUE)
variable_exists(variable = "basb", iso2 = c("fr", "de", "us", "uk"), lws = TRUE, share = TRUE)

JosepER/lissyrtools documentation built on June 12, 2025, 12:11 p.m.