Use find_question to search for information on a given question in a study and get_questions to return all the question in a study.

find_questions(study, question_name, all_columns = FALSE)

get_questions(study, all_columns = FALSE)

Arguments

study

a character specifying the name of the desired study. Find with find_studies or get_studies.

question_name

A vector of strings specifying the variable names. A search is performed for similar names from all variables in the study. Upper or lower case is ignored and regular expressions are supported.

all_columns

TRUE or FALSE stating whether to return all columns. By default it returns the `id` of the question, the `study_id`, the `short_name` of the question and the `country_iso` and `language_iso` of the question. If set to TRUE, it returns additional columns with the specific wording of the question, answer options, etc..

Value

a tibble

Examples

if (FALSE) { # Set login information here. See ?sqp_login sqp_login() # 1 is the study ESS round 1 find_questions("ESS round 1", "tvtot") # If that doesn't fit, then use get_questions and search for the question # manually through filtering: all_questions <- get_questions("ESS round 1") cnt_filt <- all_questions$country_iso == "ES" lang_filt <- all_questions$language_iso == "spa" var_filt <- grepl("TvTot", all_questions$short_name) # The desired "TvTot" variable from Spain, in Spanish all_questions[cnt_filt & lang_filt & var_filt, ] # Can also search for several variables in one call find_questions("ESS round 1", c("tvpol", "tvtot")) # Or use regular expressions. For example, to find all variables # that begin with tv find_questions(1, "^tv") }