Skip to contents

Data Access

Functions for retrieving survey data and metadata from supported platforms

forsta_get_data()
Get Forsta Survey Data
forsta_get_metadata()
Get Forsta Survey Metadata
forsta_guess_types()
Guess survey variable types
forsta_ls()
List Available Forsta Surveys
check_decipher_key()
Check Forsta Decipher key

Survey Workflow

Step-by-step helpers for building reproducible survey pipelines

step_clean_data()
Clean survey data
step_cleaning_overview()
Attach cleaning overview to the survey data.
step_prepare_forsta()
Prepare Forsta Survey Data
step_relabel()
Step relabel
step_relevel()
Relabel factor levels of survey variables
step_rename()
Rename columns
step_set____()
Placeholder for an un-guessable survey variable
step_set_derived()
Set derived (manually created) survey variables
step_set_fn()
Set open-ended numeric (FN) survey variables
step_set_folder()
Set folder for selected columns in a srv_tbl
step_set_ft()
Set open-ended text (FT) survey variables
step_set_id()
Set the ID column in the survey tibble.
step_set_ignore()
Set ignored survey variables
step_set_loop_sr()
Set loop single-response (loop_sr) variables
step_set_mr()
Set multiple-response (MR) variables
step_set_sr()
Set single-response (SR) survey variables
step_set_time()
Set time variables in a dataframe
step_set_weight()
Set survey weight (weight) variables
step_snapshot()
Take a snapshot of the current state of the data
step_srv_read()
Read Survey Data from Datalake
step_srv_source()
Get survey data from source
step_srv_write()
Write Survey Data to Datalake

Survey Tables

Utilities for managing srv_tbl metadata and presentation

as_srv_tbl()
Convert a tibble to a srv_tbl
print(<srv_tbl>)
Print method for srv_tbl.
tbl_sum(<srv_tbl>)
Summary method for srv_tbl
get_lineage()
Get survey lineage
remove_lineage()
Remove survey lineage
get_variables()
Get survey variables
get_aliases()
Get survey aliases
aliased()
Select survey columns by alias
typed()
Select survey columns by type
get_var_metadata()
Get a survey column's metadata
set_var_metadata()
Set survey variable metadata
get_cleaning_overview()
Get the cleaning overview
get_label()
Get a column's label

Labels

Helpers for working with survey labels and related metadata

srv_extract_label()
Survey Tools - Extracting The Object Label
srv_labels_copy()
Copy Variable Labels
srv_labels_fix()
Fix Data Labels
srv_replace_colnames()
Survey Tools - Replacing Column Names with Question Labels
generate_dict()
Generate variable dictionary for a dataframe
report_labelled_col_mapping()
Print detailed report on how labelled numerics are coded in a dataframe.

Reshaping & Question Processing

Functions for reshaping survey data and processing question types

srv_pivot_longer()
Survey Tools - Pivot data from wide to long
srv_pivot_wider()
Survey Tools - Pivot data from long back to wide
srv_separate_mr()
Separate Multi-Response Data into Individual Columns

Data Quality Checks

Checks for problematic response patterns and anomalous values

srv_detect_outliers()
Survey Tools - Detect Outliers (and remove)

Weighting

Functions for weighting survey data against population targets

srv_add_weights()
Weight Dataset
srv_weight() srv_genpop_margins() deprecated
Weight Dataset

Summary Statistics & Tests

Summary statistics, proportion tests, and reporting helpers for survey data

srv_prop_stats()
Proportion Statistics
srv_prop_stats_crossing()
Proportion Statistics for all Combinations of Grouping and Subject Variables
srv_prop_stats_crossing_wide()
Custom Proportion Statistics for all Combinations of Grouping and Subject Variables
srv_prop_stats_crossing_wide_xlsx()
Export summary stat as an excel file
srv_prop_stats_hierarchical()
Hierarchical Proportion Statistics
srv_prop_stats_hierarchical_xlsx()
Hierarchical Proportion Statistics XLSX
srv_prop_stats_xlsx()
Proportion Statistics xlsx Report
srv_prop_test_ref() srv_prop_test_within()
Proportion Test
srv_add_prop_test() superseded
Append a Proportion test for Count Data To Tibble
vct_prop_test_pval()
Perform vectorized hypothesis tests for the difference of two proportions

Factor functions

Specialized factor management functions inspired by forcats

fct_as_labelled()
Convert a factor to a labelled numeric
fct_case_when()
Factorize a dplyr::case_when() statement in order.
fct_data_as_labelled_verbose()
Convert all factor columns to labelled numeric columns in a dataframe
fct_data_dummify()
Convert all categorical variables into dummy/indicator variables
fct_explicit_na_auto()
Replaces NA factor values with an explicit category name
fct_to_sequential()
Convert factor levels to sequential natural numbers

String Tools

Helpers for working with strings and text values

str_get_lcp() str_get_lcs() str_remove_lcp() str_remove_lcs()
Longest Common Prefix / Suffix Helpers
srv_regex()
Helper functions to generate a common Regex pattern
srv_extract_split()
Survey Tools - Split String and Extract by Positions

Open-Ended Cleaning

Helpers for cleaning and reviewing open-ended survey responses

AI Scoring

Tools for AI-based scoring of open-ended survey responses

aisc_score()
Score Survey Responses with AI
aisc_spec_generate() aisc_spec_write() aisc_spec_read()
AI Scoring Specification Tools
oe_responses_remote_work
Synthetic Open-Ended Responses About Remote Work

Survey Cards

CLI card summaries for survey data

column_card()
Create a card display for a single data column
data_card()
Create cards for all columns in a dataframe

Example Data

Example datasets and objects used in documentation and workflows

ds_chakra_expl
Crunch Datasets
ds_custom
Survey Example datasets for our srv_summary_prop_stat_custom function
ds_newsletter
Survey Example datasets for our srv_weights function
ds_newsletter_new
Survey Example datasets for our srv_weights function
ds_newsletter_oe
Newsletter sample data for applying open end cleaning functions
ds_survey_example
Survey Example datasets for our srv_ functionalities
ds_survey_tidy
Survey Example datasets for our srv_ functionalities
srv_example
Survey Example dataset for our step_ functionalities.