Skip to contents

FOKUS metadata

Metadata about the FOKUS surveys, generated from the raw supplemental date-specific questionnaire data files found under data-raw/questionnaire/YYYY-MM-DD.toml that serve as a “source of truth” for the predicate functions.

all_ballot_dates
FOKUS-covered ballot dates
all_cantons
FOKUS-covered cantons
all_ballot_types
Ballot types
all_lvls
Political levels
all_prcds
Election procedures
all_proposal_types
Referendum proposal types
all_qstn_groups
Standardized referendum proposal question groups
all_argument_sides
Referendum proposal argument sides
all_main_motive_types
Referendum proposal main motive types
all_election_seat_types
Election seat types
all_response_option_types
Response option types
all_postal_dispatch_types
Postal dispatch types
all_postal_dispatch_ways
Postal dispatch ways
all_langs
Languages
all_name_types
Name types

Predicates

Predicate functions based on the metadata and the raw questionnaire data.

Fundamental predicates

Fundamental predicate functions never fail in case of incomplete raw questionnaire data (they do still fail in case of completely missing questionnaire data for the specified ballot date and possibly canton).

cantons()
Get cantons covered by FOKUS survey
lvls()
Get ballot's political levels
ballot_types()
Get ballot types
prcds()
Get ballot's election procedures
proposal_nrs()
Get ballot's referendum proposal numbers
election_nrs()
Get ballot's election numbers
election_prcds()
Get ballot's election procedures
proposal_qstn_groups()
Get referendum proposal question groups
qstn_groups_proposal_nrs()
Get referendum proposal numbers with question group
survey_channels()
Get survey channels
is_representative()
Determine whether survey is based on representative sample
n_proposals()
Get number of referendum proposals
n_elections()
Get number of elections
has_referendum()
Determine whether ballot includes a referendum
has_election()
Determine whether ballot includes an election
has_ballot_type()
Determine whether ballot includes type
has_lvl()
Determine whether ballot includes a political level
has_proposal_nrs()
Determine whether ballot includes referendum proposals
has_election_nrs()
Determine whether ballot includes elections
combos_ballot_types()
Get ballot type combinations

Proposal predicates

proposal_type()
Get referendum proposal type
proposal_name()
Get referendum proposal name
proposal_name_gender()
Get German referendum proposal name's grammatical gender
is_proposal_name_plural()
Determine whether German referendum proposal name is plural
proposal_arguments()
Get referendum proposal's arguments
proposal_argument()
Get referendum proposal argument
proposal_main_motives()
Get referendum proposal's main motives
n_proposal_arguments()
Get referendum proposal's number of arguments
n_proposal_main_motives()
Get referendum proposal's number of main motives
has_proposal_arguments()
Determine whether arguments have been queried for referendum proposal
has_proposal_main_motives()
Determine whether main motives have been queried for referendum proposal
argument_proposal_nrs()
Get referendum proposal numbers with arguments
main_motive_proposal_nrs()
Get referendum proposal numbers with arguments
combos_proposals()
Get referendum proposal combinations
combos_proposal_arguments()
Get referendum proposal combinations for which arguments have been queried
combos_proposal_main_motives()
Get referendum proposal combinations for which main motives have been queried

Election predicates

election_name()
Get election name
election_names_combined()
Get combined elections name
election_candidates()
Get majoritarian election's candidates
election_parties()
Get proportional election's political parties
election_tickets()
Get proportional election's tickets
past_election_date()
Get election's past date
n_election_seats()
Get number of majoritarian election seats
n_election_candidates()
Get number of (officially registered) majoritarian election candidates
requires_candidate_registration()
Determine whether majoritarian election requires candidate registration
combos_elections()
Get election combinations

Skill question predicates

skill_question_nrs()
Get skill question numbers
n_skill_questions()
Get number of skill questions
skill_question()
Get skill question
skill_question_response_options()
Get skill question response options
skill_question_answer_nr()
Get correct skill question answer number
skill_question_proposal_nrs()
Get referendum proposal numbers with skill questions

Other predicates

ballot_title()
Get ballot title
political_issues()
Get political issues
postal_dispatch_way()
Get postal dispatch way
response_options()
Get response options

Questionnaire and survey

Datasets and functions to conduct a FOKUS survey.

Datasets

The FOKUS survey questionnaires and supplemental information as structured data.

qstnrs
Questionnaire data
proposals
Proposal data
elections
Election data
ballots
Ballot data

Data import

Functions to access FOKUS data from the private FOKUS repository.

read_easyvote_municipalities()
Read in easyvote municipality data
read_online_participation_codes()
Read in online participation codes
read_survey_data()
Read in generated survey data
read_voting_register_data_extra()
Read in extra voting register data
read_voting_register_ids()
Read in voting register identifiers
read_private_file()
Read in file from private FOKUS repository

Data export

Functions to export data necessary to conduct a FOKUS survey and perform survey data analysis.

export_qstnr()
Export questionnaire data
export_qr_codes()
Export QR codes with personalized survey URL
export_print_recipients()
Export print recipients data
export_easyvote_municipalities()
Export easyvote municipality details
write_private_file()
Write file to private FOKUS repository
var_lbl()
Get variable description
var_lvls()
Determine variable's political level(s)
var_proposal_nr()
Determine variable's proposal number
var_skill_question_nr()
Determine variable's skill question number
var_title()
Get variable title
var_val_set()
Get variable's value set
add_vars_to_combos()
Add variable names to combination list
is_skill_question_var()
Determine whether variable is skill question

Variable name shortening

shorten_var_names()
Shorten variable names to a maximum length of 32 characters
shorten_colnames()
Shorten column names to a maximum length of 32 characters
restore_colnames()
Restore original/unshortened column names

Text phrasing

phrase()
Phrase term
phrase_date()
Phrase (ballot) date
phrase_election_candidate()
Phrase majoritarian election's candidate(s)
phrase_proposal_name_de()
Get declined German proposal name

Google Apps

backup_g_file()
Backup Google Drive file locally
backup_g_sheet()
Backup Google Sheet locally
upload_to_g_drive()
Upload files to Google Drive
g_file_mod_time()
Get Google Drive file modification timestamp

Miscellaneous

lgl_to_unicode()
Convert logical vector to Unicode symbols ✅ and ❌
md_emphasize()
Emphasize xth element of character vector (Markdown)
pkg_config
fokus package configuration metadata