Package 'quiveR'

Title: A set of tools for interacting with KoBo and analyzing datasets from it
Description: A set of tools for interacting with KoBo and analyzing datasets from it.
Authors: Iyed Ghedamsi [aut, cre]
Maintainer: Iyed Ghedamsi <[email protected]>
License: MIT + file LICENSE
Version: 0.0.0.9003
Built: 2024-11-25 03:38:31 UTC
Source: https://github.com/iyedg/quiveR

Help Index


Generate a changelog from two data frames.

Description

Generate a changelog from two data frames.

Usage

generate_changelog(
  .x,
  .y,
  id_cols,
  names_to = "question",
  .x_values_to = "raw_value",
  .y_values_to = "transformed_value"
)

Arguments

.x

data frame x

.y

data frame y

id_cols

columns common between x and y that uniquely identify observations

names_to

name of the column containing the pivoted column names

.x_values_to

name of the column containing values from x

.y_values_to

name of the column containing values from y

Value

data frame


Get the columns corresponding to a ⁠select multiple⁠ question

Description

Get the columns corresponding to a ⁠select multiple⁠ question

Usage

get_question_columns(.df, question_label, group_sep = "/")

Arguments

.df

The survey data frame

question_label

The label of the question

group_sep

The group separator used in the KoBo export

Value

A list of columns that correspond to each individual possible choice for question_label

Examples

get_question_columns(lby_msna2021, "safety_concerns")
get_question_columns(lby_msna2021, "safety_concerns_boys")
get_question_columns(lby_msna2021, "safety_concerns_girls")

Harmonized names for Libyan Municipality names

Description

A mapping of Libyan Municipality names and a harmonized name used by REACH for that Municipality.

Usage

harmonized_municipality_names

Format

An object of class character of length 8.

Source

reach


Harmonized names for Libyan Neighborhood names

Description

A mapping of Libyan Neighborhood names and a harmonized name used by REACH for that Neighborhood.

Usage

harmonized_neighborhood_names

Format

An object of class character of length 2.

Source

reach


Download survey responses as a dataset

Description

Download survey responses as a dataset

Usage

kobo_download_dataset(
  server_url = "https://kobo.humanitarianresponse.info",
  type = "xls",
  lang = "English",
  fields_from_all_versions = TRUE,
  group_sep = "/",
  asset_uid,
  user_name,
  user_password,
  file_path,
  max_retries = 12
)

Arguments

server_url

URL of the KoBo Server

type

Filetype for the export

lang

Language of the labels used in the export. Can be 'xls'

fields_from_all_versions

Whether to include fields from all versions of the survey

group_sep

The character separator for groups

asset_uid

The UUID of the survey

user_name

The User Name

user_password

The Password

file_path

The file path to which the dataset is saved

max_retries

The number of retries when downloading


Parse a KoBo expression into R.

Description

Parse a KoBo expression into R.

Usage

kobo_parse_expression(statement, as_string = FALSE)

Arguments

statement

a string representing a KoBo expression

as_string

whether to transform the result of parsing into an expression

Value

an R expression or its string representation

Examples

kobo_parse_expression("${hoh}")
kobo_parse_expression("${hoh}", as_string = TRUE)
kobo_parse_expression("selected(${hoh}, 'no')")
kobo_parse_expression("selected(${hoh}, 'no')", as_string = TRUE)
lby_msna2021 %>%
  dplyr::filter(!!kobo_parse_expression("selected(${hoh}, 'no')")) %>%
  dplyr::distinct(hoh)

Libyan Districts

Description

A dataset containing the identifiers as well as the Arabic and English names of Libyan Districts

Usage

lby_districts

Format

An object of class data.frame with 22 rows and 4 columns.

Details

district_id

A unique identifier for the District

district_name_ar

The Districts' name in Arabic

district_name_en

The Districts' name in English

district_region_id

The region to which the Districts belongs

Source

reach


REACH Libya MSNA 2021 Dataset (Refugee and Migrant Population)

Description

In response to a lack of recent data on the humanitarian situation in Libya, REACH conducted a multi-sectoral needs assessment (MSNA) from June-July 2021 to provide timely information on the needs and vulnerabilities of refugees and migrants. REACH designed the data collection and analysis tools, and consulted with all sectors and working groups active in the Libyan response to revise indicators.

Usage

lby_msna2021

Format

An object of class tbl_df (inherits from tbl, data.frame) with 1554 rows and 690 columns.

Source

REACH Resource Centre


REACH Libya MSNA 2021 Choices (Refugee and Migrant Population)

Description

In response to a lack of recent data on the humanitarian situation in Libya, REACH conducted a multi-sectoral needs assessment (MSNA) from June-July 2021 to provide timely information on the needs and vulnerabilities of refugees and migrants. REACH designed the data collection and analysis tools, and consulted with all sectors and working groups active in the Libyan response to revise indicators.

Usage

lby_msna2021_choices

Format

An object of class tbl_df (inherits from tbl, data.frame) with 1351 rows and 7 columns.

Source

REACH Resource Centre


REACH Libya MSNA 2021 Survey (Refugee and Migrant Population)

Description

In response to a lack of recent data on the humanitarian situation in Libya, REACH conducted a multi-sectoral needs assessment (MSNA) from June-July 2021 to provide timely information on the needs and vulnerabilities of refugees and migrants. REACH designed the data collection and analysis tools, and consulted with all sectors and working groups active in the Libyan response to revise indicators.

Usage

lby_msna2021_survey

Format

An object of class tbl_df (inherits from tbl, data.frame) with 242 rows and 17 columns.

Source

REACH Resource Centre


Libyan Municipalities

Description

A dataset containing the identifiers as well as the Arabic and English names of Libyan Municipalities

Usage

lby_municipalities

Format

An object of class data.frame with 100 rows and 5 columns.

Details

municipality_id

A unique identifier for the Municipality

municipality_name_ar

The Municipality's name in Arabic

municipality_name_en

The Municipality's name in English

municipality_district_id

The district to which the Municipality belongs

municipality_region_id

The region to which the Municipality belongs

Source

reach


Libyan Regions

Description

A dataset containing the identifiers as well as the Arabic and English names of Libyan Regions

Usage

lby_regions

Format

An object of class data.frame with 3 rows and 3 columns.

Details

region_id

A unique identifier for the Region

region_name_ar

The Region's name in Arabic

region_name_en

The Region's name in English

Source

reach