2 Quick Start
2.1 Installation
Run the following commands in your R console to install clusteR:
install.packages("devtools")
devtools::install_github("alectries/clusteR")
You can update clusteR by running devtools::update_packages() and selecting
the option for clusteR.
2.2 Setting up
Each survey should be run in a unique folder. clusteR will set up a survey environment in this folder with a custom file structure. You may add and modify files and folders within this structure as needed. clusteR will ignore files that it did not create or does not need.
To load clusteR, run:
library(clusteR)
R is case-sensitive, so the capital R matters! On first load in a new folder,
clusteR will give a warning:
Warning message:
clusteR environment not configured!
! Please run clusteR::setup() to set up your survey environment.
You will need to run setup() to create the survey environment in your working
directory. Use either setwd() or create an R project in RStudio in your
desired folder before running setup().
2.3 Workflow
Your project will likely go through three phases: setup, collection, and data analysis. Below is an overview of the functions you are most likely to use in each phase.
2.3.1 Setup and sampling
-
make_clustersto randomly select U.S. Census blocks, weighted by their population, to serve as clusters.-
view_mapto view a simple graphical map of sampled clusters.
-
-
setupto set up the clusteR environment.-
setup_get_alcto establish a connection to an Alchemer survey. -
setup_get_csvto establish a connection to a CSV file with survey response data.
-
2.3.2 Collection
-
make_emailto generate a PDF or CSV with information
needed to send emails to cohort members. -
make_mailingto generate a PDF or CSV with information needed to send physical mailings to cohort members. -
make_phoneto generate a PDF or CSV with information needed to make calls to cohort members. -
make_groupsto automatically group clusters by physical proximity and output a file to make manual adjustments for door-to-door interviews. -
make_walkmapto regenerate the cluster map, taking into account manual adjustments. -
make_walklistto generate PDF walk lists for groups assigned bymake_groups, taking into account manual adjustments.-
custom_walklistto save a starter custom template for walk lists.
-
-
update_cohortto obtain, join, and view updated cohort information from the data source and the Editor.-
update_confirmto apply updates to the cohort file. -
view_cohortto view the full cohort file. -
search_cohortto view filtered results from the cohort file. -
restore_cohortto restore an archived version of the cohort file.
-
-
view_progressto generate a report on survey completion by cluster. -
get_datato download and archive survey responses from a pre-specified data source.-
get_alc, generally used byget_data, to retrieve data from Alchemer. -
get_csv, generally used byget_data, to retrieve data from a CSV.
-
2.3.3 Data analysis
-
clean_datato clean downloaded, standardized survey data.-
clean_weight, withinclean_data, to calculate and save survey weights.
-
-
view_toplineto analyze responses and view or export overall results.-
custom_toplineto save a starter custom template for topline reports.
-
-
view_breakdownto analyze responses and break them down by a stratification variable.-
custom_breakdownto save a starter custom template for breakdown reports.
-
-
export_cohortto export the cohort file to a CSV. -
export_datato export survey responses to a CSV.