{"id":17153040,"url":"https://github.com/martinctc/surveytoolbox","last_synced_at":"2025-10-30T11:57:53.537Z","repository":{"id":108325344,"uuid":"163460092","full_name":"martinctc/surveytoolbox","owner":"martinctc","description":"A R package containing useful support functions for survey analysis.","archived":false,"fork":false,"pushed_at":"2025-02-19T10:23:22.000Z","size":301,"stargazers_count":25,"open_issues_count":2,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-27T03:41:45.064Z","etag":null,"topics":["r","survey-analysis"],"latest_commit_sha":null,"homepage":"https://martinctc.github.io/surveytoolbox/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/martinctc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-29T00:18:47.000Z","updated_at":"2025-02-19T10:19:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"78cd608b-6037-412d-8eaf-46f08a15b38b","html_url":"https://github.com/martinctc/surveytoolbox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinctc%2Fsurveytoolbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinctc%2Fsurveytoolbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinctc%2Fsurveytoolbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinctc%2Fsurveytoolbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinctc","download_url":"https://codeload.github.com/martinctc/surveytoolbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717234,"owners_count":21150387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","survey-analysis"],"created_at":"2024-10-14T21:45:03.921Z","updated_at":"2025-10-30T11:57:48.493Z","avatar_url":"https://github.com/martinctc.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# surveytoolbox\n\n[![R build status](https://github.com/martinctc/surveytoolbox/workflows/R-CMD-check/badge.svg)](https://github.com/martinctc/surveytoolbox/actions)\n[![CodeFactor](https://www.codefactor.io/repository/github/martinctc/surveytoolbox/badge)](https://www.codefactor.io/repository/github/martinctc/surveytoolbox)\n\nR package containing tidy support functions for survey analysis.\n\nCurrently under development! \n(First created 29 Dec 2018)\n\n\n\u003cimg src=\"https://raw.githubusercontent.com/martinctc/surveytoolbox/master/icons/surveytoolbox_hex.svg\" align=\"right\" height = 150 width = 150/\u003e\n\n------------------------------------------------------------------------\n\n### About this package\n\nIt is from my own experience of analysing survey data in R that whilst more often than not you're able to do what you want to do, there is a sense that the 'essential functions' are scattered across different packages and Stack Overflow answers. This is understandable, as the workflow of every analyst is bound to be unique, and it  isn't necessarily sensible to have 100-odd functions collected in a single package for each user - there is bound to be a need to draw functions from multiple packages.  \n\nThis is a curated collection of functions that I've either written or come across over the past years. In my analysis workflow, I often use these functions in conjunction with `tidyverse`, `srvyr` (allows you to work with weighted data), and `janitor`. There are also some miscellaneous functions which work with common survey analysis techniques such as factor analysis (using the `factanal()` function from `stats)\n\n**The aim of this package is to attempt to organise things a bit and add value by curation.**\n\nAdditional reading on functions from this package:\n- [Working with SPSS labels in R](https://martinctc.github.io/blog/working-with-spss-labels-in-r/)\n- Applying the timestamp function `timed_fn()`: [RStudio Projects and Working Directories: A Beginner's Guide](https://martinctc.github.io/blog/rstudio-projects-and-working-directories-a-beginner%27s-guide/)\n\n---\n\n### Summary of Functions\n\nThere are broadly several groups of functions that you can find in this package:\n- Creating dummy variables, and variations of these which take inputs from multiple categorical variables (`superspread()`)\n- Copying data to and from Excel for ad-hoc analysis (`copy_df()`)\n- Functions for changing the scale of Likert-scale type questions, including Max-Min Scaling (`likert_reverse()`)\n- Cleaning variable names\n- Converting .sav (SPSS) files to smaller, faster-to-load RDS files (e.g. `sav_to_rds()`)\n- Converting one or more categorical variable(s) into other variable types, such as dummy variables (binary), count variables (numeric), or \"fill\" variables (fills values from a required column if condition is TRUE)\n- Functions for recoding variable and value labels (e.g. `recode_vallab()`, `set_varl()`, `set_vall()`)\n\nThere is also a convenience function (`apply_row()`) for performing rowwise operations, which is particularly useful when creating new variables based on a selection of columns on the datas. \n\n---\n\n### Installation\n\nsurveytoolbox is not released on CRAN (yet). \nYou can install the latest development version from GitHub with:\n\n```R\ninstall.packages(\"devtools\")\ndevtools::install_github(\"martinctc/surveytoolbox\")\n```\n---\n\n### Examples\n\nHere is an example of how to use the `apply_row()` function to create new variables:\n```R\nlibrary(tidyverse)\nlibrary(surveytoolbox)\n\n# Create a new column called `Sepal_Sum`\n# Sum all values with columns containing \"Sepal\"\niris %\u003e%\n  mutate(Sepal_Sum = apply_row(., select_helpers = contains(\"Sepal\"), sum, na.rm = TRUE))\n```\n---\n\n### News and Updates\n\nThis package is currently still under development, so it does come with a health advice: if you do wish to use them - have a check and run through the examples before assimilating them into your analysis. \n\nNote: Previously named 'surveytools', but now renamed to 'surveytoolbox' avoid confusion with another similar package of the same name (8th March 2019).\n\n12th Jan 2020 - Functions relating to modelling have now been moved to a new package [modeltoolbox](https://www.github.com/martinctc/modeltoolbox).\n\n\n---\n### Contact me\n\nPlease feel free to submit suggestions and report bugs: \u003chttps://github.com/martinctc/surveytoolbox/issues\u003e\n\nAlso check out my [website](https://martinctc.github.io) for my other work and packages.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinctc%2Fsurveytoolbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinctc%2Fsurveytoolbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinctc%2Fsurveytoolbox/lists"}