{"id":19994048,"url":"https://github.com/kapsner/sjtable2df","last_synced_at":"2025-06-21T00:07:49.436Z","repository":{"id":37400484,"uuid":"428426574","full_name":"kapsner/sjtable2df","owner":"kapsner","description":"Convert 'sjPlot' HTML-Tables to R 'data.frame'","archived":false,"fork":false,"pushed_at":"2025-04-05T11:53:09.000Z","size":93,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-21T00:03:55.815Z","etag":null,"topics":["converter","cran","data-frame","r","r-package","sjplot","tables"],"latest_commit_sha":null,"homepage":"https://cran.r-project.org/web/packages/sjtable2df/vignettes/Overview.html","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kapsner.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,"zenodo":null}},"created_at":"2021-11-15T21:26:56.000Z","updated_at":"2025-04-05T11:53:13.000Z","dependencies_parsed_at":"2024-05-17T14:45:37.492Z","dependency_job_id":"5c5baec4-d0d3-4ed9-83f1-622a8ebfcbe7","html_url":"https://github.com/kapsner/sjtable2df","commit_stats":{"total_commits":46,"total_committers":4,"mean_commits":11.5,"dds":0.3913043478260869,"last_synced_commit":"3c47e51bbea5797317e74b8ead0409d4411493c0"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/kapsner/sjtable2df","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kapsner%2Fsjtable2df","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kapsner%2Fsjtable2df/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kapsner%2Fsjtable2df/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kapsner%2Fsjtable2df/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kapsner","download_url":"https://codeload.github.com/kapsner/sjtable2df/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kapsner%2Fsjtable2df/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261039081,"owners_count":23100969,"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":["converter","cran","data-frame","r","r-package","sjplot","tables"],"created_at":"2024-11-13T04:53:53.114Z","updated_at":"2025-06-21T00:07:44.414Z","avatar_url":"https://github.com/kapsner.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# sjtable2df\n\n\u003c!-- badges: start --\u003e\n\n[![](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n[![](https://www.r-pkg.org/badges/version/sjtable2df)](https://cran.r-project.org/package=sjtable2df)\n[![CRAN\nchecks](https://badges.cranchecks.info/worst/sjtable2df.svg)](https://cran.r-project.org/web/checks/check_results_sjtable2df.html)\n[![](http://cranlogs.r-pkg.org/badges/grand-total/sjtable2df?color=blue)](https://cran.r-project.org/package=sjtable2df)\n[![](http://cranlogs.r-pkg.org/badges/last-month/sjtable2df?color=blue)](https://cran.r-project.org/package=sjtable2df)\n[![Dependencies](https://tinyverse.netlify.app/badge/sjtable2df)](https://cran.r-project.org/package=sjtable2df)\n[![R build\nstatus](https://github.com/kapsner/sjtable2df/workflows/R%20CMD%20Check%20via%20%7Btic%7D/badge.svg)](https://github.com/kapsner/sjtable2df/actions)\n[![R build\nstatus](https://github.com/kapsner/sjtable2df/workflows/lint/badge.svg)](https://github.com/kapsner/sjtable2df/actions)\n[![R build\nstatus](https://github.com/kapsner/sjtable2df/workflows/test-coverage/badge.svg)](https://github.com/kapsner/sjtable2df/actions)\n[![](https://codecov.io/gh/https://github.com/kapsner/sjtable2df/branch/main/graph/badge.svg)](https://codecov.io/gh/https://github.com/kapsner/sjtable2df)\n\n\u003c!-- badges: end --\u003e\n\nThe [`sjPlot`](https://CRAN.R-project.org/package=sjPlot) R package is a\ngreat package for visualizing results.\n\nHowever, the tables created using the functions\n[`sjPlot::tab_model`](https://www.rdocumentation.org/packages/sjPlot/versions/2.8.4/topics/tab_model)\nor\n[`sjPlot::tab_xtab`](https://www.rdocumentation.org/packages/sjPlot/versions/2.8.4/topics/tab_xtab)\nreturn HTML tables and are not straightforward to use in R, especially\nwhen trying to integrate them into pdf- or word-documents using\nRmarkdown.\n\nThe `sjtable2df` R package’s goal is to overcome this and to provide an\neasy interface for converting `sjPlot`’s HTML tables to `data.frame`,\n`data.table`, or `kable` objects for further usage in R or Rmarkdown.\n\nCurrently, `sjtable2df` provides two functions to convert tables created\nfrom `sjPlot`’s functions\n[`tab_model`](https://www.rdocumentation.org/packages/sjPlot/versions/2.8.4/topics/tab_model)\nand\n[`tab_xtab`](https://www.rdocumentation.org/packages/sjPlot/versions/2.8.4/topics/tab_xtab):\n`sjtable2df::mtab2df` and `sjtable2df::xtab2df`.\n\n## Install\n\n``` r\ninstall.packages(\"sjtable2df\")\n```\n\nThe development version is available from GitHub:\n\n``` r\ninstall.packages(\"remotes\")\nremotes::install_github(\"kapsner/sjtable2df\")\n```\n\n## Example\n\nFurther details and examples are given in the package’s\n[vignette](https://cran.r-project.org/web/packages/sjtable2df/vignettes/Overview.html).\n\n``` r\nlibrary(sjtable2df)\nset.seed(1)\ndataset \u003c- data.table::data.table(\n  \"var1\" = sample(\n    x = c(\"yes\", \"no\"),\n    size = 100,\n    replace = TRUE,\n    prob = c(.3, .7)\n  ),\n  \"var2\" = sample(\n    x = c(\"yes\", \"no\"),\n    size = 100,\n    replace = TRUE\n  )\n)\n\nxtab \u003c- sjPlot::tab_xtab(\n  var.row = dataset$var1,\n  var.col = dataset$var2,\n  show.summary = TRUE,\n  use.viewer = FALSE\n)\n\nsjtable2df::xtab2df(xtab = xtab, output = \"data.table\")\n#\u003e     var1 var2 no var2 yes                               Total\n#\u003e 1:    no      29       39                                  68\n#\u003e 2:   yes      18       14                                  32\n#\u003e 3: Total      47       53                                 100\n#\u003e 4:                        χ2=1.116 · df=1 · φ=0.127 · p=0.291\n\nsjtable2df::xtab2df(xtab = xtab, output = \"kable\", format = \"latex\")\n#\u003e \\begin{tabular}[t]{l|l|l|l}\n#\u003e \\hline\n#\u003e var1 \u0026 var2 no \u0026 var2 yes \u0026 Total\\\\\n#\u003e \\hline\n#\u003e no \u0026 29 \u0026 39 \u0026 68\\\\\n#\u003e \\hline\n#\u003e yes \u0026 18 \u0026 14 \u0026 32\\\\\n#\u003e \\hline\n#\u003e Total \u0026 47 \u0026 53 \u0026 100\\\\\n#\u003e \\hline\n#\u003e \\multicolumn{4}{l}{\\textsuperscript{} $χ2=1.116 · df=1 · φ=0.127 · p=0.291$}\\\\\n#\u003e \\end{tabular} \n```\n\n## More Information\n\n- [sjPlot R\n  package](https://cran.r-project.org/web/packages/sjPlot/index.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkapsner%2Fsjtable2df","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkapsner%2Fsjtable2df","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkapsner%2Fsjtable2df/lists"}