find_questions.Rd
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)
study | a character specifying the name of the desired study.
Find with |
---|---|
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 |
|
a tibble
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") }