{"id":22305212,"url":"https://github.com/crunch-io/crunchtabs","last_synced_at":"2025-07-29T04:32:07.499Z","repository":{"id":18550888,"uuid":"84587442","full_name":"Crunch-io/crunchtabs","owner":"Crunch-io","description":"Report generation for Crunch and generic datasets in R","archived":false,"fork":false,"pushed_at":"2024-08-17T00:54:11.000Z","size":4517,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":41,"default_branch":"main","last_synced_at":"2025-04-05T07:41:34.425Z","etag":null,"topics":["codebook","cross-tabulation","crunch","pdf-reports","topline"],"latest_commit_sha":null,"homepage":"https://crunch-io.github.io/crunchtabs/articles/Overview.html","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Crunch-io.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"license.MD","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":"2017-03-10T18:06:03.000Z","updated_at":"2024-11-02T23:37:15.000Z","dependencies_parsed_at":"2024-12-03T19:10:32.636Z","dependency_job_id":"28a9d450-14ea-4278-b933-ba698da8cbf5","html_url":"https://github.com/Crunch-io/crunchtabs","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/Crunch-io/crunchtabs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crunch-io%2Fcrunchtabs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crunch-io%2Fcrunchtabs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crunch-io%2Fcrunchtabs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crunch-io%2Fcrunchtabs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Crunch-io","download_url":"https://codeload.github.com/Crunch-io/crunchtabs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Crunch-io%2Fcrunchtabs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267629203,"owners_count":24118171,"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","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["codebook","cross-tabulation","crunch","pdf-reports","topline"],"created_at":"2024-12-03T19:10:24.777Z","updated_at":"2025-07-29T04:32:07.062Z","avatar_url":"https://github.com/Crunch-io.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crunchtabs\n\nCrunchtabs allow for the automatic generation of toplines, crosstabulation and codebooks directly from a crunch dataset.\n\n[![R-CMD-check](https://github.com/Crunch-io/crunchtabs/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/Crunch-io/crunchtabs/actions/workflows/check-standard.yaml) [![codecov](https://codecov.io/gh/Crunch-io/crunchtabs/branch/main/graph/badge.svg)](https://codecov.io/gh/Crunch-io/crunchtabs)\n\n## Quick Start\n\nFor a broader introduction please see our [introductory vignette](https://crunch-io.github.io/crunchtabs/articles/Overview.html). For codebooks, see [codebooks](https://crunch-io.github.io/crunchtabs/articles/Codebooks.html)\n\n### 1. Install tinytex\n\nTo make PDF reports, you'll need a working LaTeX installation. One way to get this is with the [tinytex](https://yihui.name/tinytex/) package. Or, see \u003chttps://www.latex-project.org/get/\u003e to install everything. We strongly recommend installing tinytex because it reduces the number of potential problems.\n\n    install.packages('tinytex')\n    tinytex::install_tinytex()\n\n### 2. Install crunchtabs\n\n    # install.packages(\"remotes\")\n    remotes::install_github(\"Crunch-io/crunchtabs\")\n\n### Create a Topline\n\nGenerating a topline report is quick and easy!\n\n    # library(crunchtabs)\n    # login()\n\n    ds = loadDataset(\"Example dataset\")\n    # Use ds = newExampleDataset() if not found!\n\n    toplines_summary \u003c- crosstabs(dataset = ds)\n    writeLatex(toplines_summary, filename = \"output\", pdf = TRUE) # output.pdf will be written \n\n![Topline Example from the Example Dataset](https://raw.githubusercontent.com/Crunch-io/crunchtabs/main/vignettes/example-001-topline.png)\n\n### Create a recontact or pre/post Topline\n\nLet's say you have a datasaet where you have asked the same question twice. Once \"before\" and once \"after\". `recontact_topline` generates a report that shows these two side by side as if they were a categorical array. Making it easier for reviewers to identify differences over time.\n\nThe function assumes your \"before\" and \"after\" questions are named in the same way with a suffix.\n\n-   q1_pre\n-   q1_post\n-   q3_pre\n-   q3_post\n\n```{=html}\n\u003c!-- --\u003e\n```\n    # library(crunchtabs)\n    # login()\n    ds \u003c- loadDataset(\"Your Recontact Survey\")\n    rc \u003c- recontact_toplines(\n      ds, \n      questions = c(\"q1\", \"q3\"), # The base question name without suffixes\n      suffixes = c(\"_pre\", \"_post\"), # The suffixes\n      labels = c(\"Pre\", \"Post\"), # The labels associated with the pre/post\n      weights = c(\"weight1\", \"weight2\") # The weights associated with the pre/post\n    )\n\n    writeLatex(rc, pdf = TRUE)\n\n![Recontact Example](https://raw.githubusercontent.com/Crunch-io/crunchtabs/main/vignettes/example-012-recontact-default.png)\n\nDepending on your preferences you can also flip grids if have more categories than waves:\n\n    theme \u003c- themeNew(\n      default_theme = themeDefaultLatex(), \n      latex_flip_specific_grids = c(\"q1\")\n    )\n\n    writeLatex(rc, theme = theme, pdf = TRUE)\n\n![Recontact Example - Flipped Grid](https://raw.githubusercontent.com/Crunch-io/crunchtabs/main/vignettes/example-013-recontact-flipped-grid.png)\n\n### Create a Tracking Report\n\nWhile recontact reports are designed for questions asked in the same dataset, we also have the ability to present questions asked in multiple datasets in a similar fashion. There are some critical nuances here that should be understood - we recommend reviewing the eponymously named vignette. \n\n    # library(crunchtabs)\n    # login() \n    \n    theme \u003c- themeNew(\n      default_theme = themeDefaultLatex(), \n      latex_flip_grids = TRUE\n    )\n    \n    ds1 \u003c- loadDataset(\"My DS Wave 1\")\n    ds2 \u003c- loadDataset(\"My DS Wave 2\")\n    ds3 \u003c- loadDataset(\"My DS Wave 3\")\n    \n    ct \u003c- trackingReport(\n      dataset_list = list(ds1, ds2, ds3), \n      vars = c(\"question_alias1\", \"question_alias2\", \"question_alias3\"),\n      wave_labels = NULL\n    )\n    \n    writeLatex(ct, pdf = TRUE, theme = theme)\n\n\n![Tracking Report Example - Flipped grids](https://raw.githubusercontent.com/Crunch-io/crunchtabs/main/vignettes/ex016.png)  \n\n### Create a Cross Tabulation\n\nThe only additional step required for a cross tab report is to create a `banner` object. Then, setting it as the `banner` argument for the `crosstabs` function. Below, we create a cross tabulation report that shows the type of pet(s) respondents own to our survey for every question in the survey. Once you have run the code, we encourage you to open the resulting `output.pdf` file. Inside of the report you will find a cross tabulation of all questions by pet ownership.\n\n    # library(crunchtabs)\n    # login()\n\n    ds = loadDataset(\"Example dataset\")\n    # Use ds = newExampleDataset() if not found!\n\n    ct_banner \u003c- banner(ds, vars = list(`banner 1` = c('allpets')))\n    ct_summary \u003c- crosstabs(dataset = ds, banner = ct_banner) # banner parameter set here\n    writeLatex(ct_summary, filename = \"output\", pdf = TRUE) # output.pdf will be written \n\n![Cross Tabulation Example from the Example Dataset](https://raw.githubusercontent.com/Crunch-io/crunchtabs/main/vignettes/example-002-crosstabs.png)\n\n## Excel\n\nTo create documents in excel, the process is the same as that for creating PDF reports. However, in the last line of our example scripts we use `writeExcel` instead of `writeLatex` while also removing the `pdf = TRUE` argument. As with PDF reports, there are a large amount of options that can be set to adjust the look and feel of the resulting Excel spreadsheets.\n\n    # ... cross tab\n    writeExcel(ct_summary, filename = \"output\") # output.xlsx will be written \n\n    # ... topline, not yet implemented\n    # writeExcel(toplines_summary, filename = \"output\") # output.xlsx will be written \n\n![Cross Tabulation Excel Example from the Example Dataset](https://raw.githubusercontent.com/Crunch-io/crunchtabs/main/vignettes/example-003-excel-ct.png)\n\n## Generating Codebooks\n\nGenerating a codebook is easy!\n\n    # library(crunchtabs)\n    # login()\n\n    ds = loadDataset(\"Example dataset\")\n    # Use ds = newExampleDataset() if not found!\n\n    writeCodeBookLatex(ds)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrunch-io%2Fcrunchtabs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrunch-io%2Fcrunchtabs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrunch-io%2Fcrunchtabs/lists"}