sjtable2df

Convert 'sjPlot' HTML-Tables to R 'data.frame'

https://github.com/kapsner/sjtable2df

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.5%) to scientific vocabulary

Keywords

converter cran data-frame r r-package sjplot tables
Last synced: 6 months ago · JSON representation

Repository

Convert 'sjPlot' HTML-Tables to R 'data.frame'

Basic Info
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 1
  • Open Issues: 1
  • Releases: 1
Topics
converter cran data-frame r r-package sjplot tables
Created over 4 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License

README.md

sjtable2df

CRAN
checks Dependencies R build
status R build
status R build
status

The sjPlot R package is a great package for visualizing results.

However, the tables created using the functions sjPlot::tab_model or sjPlot::tab_xtab return HTML tables and are not straightforward to use in R, especially when trying to integrate them into pdf- or word-documents using Rmarkdown.

The sjtable2df R package’s goal is to overcome this and to provide an easy interface for converting sjPlot’s HTML tables to data.frame, data.table, or kable objects for further usage in R or Rmarkdown.

Currently, sjtable2df provides two functions to convert tables created from sjPlot’s functions tab_model and tab_xtab: sjtable2df::mtab2df and sjtable2df::xtab2df.

Install

r install.packages("sjtable2df")

The development version is available from GitHub:

r install.packages("remotes") remotes::install_github("kapsner/sjtable2df")

Example

Further details and examples are given in the package’s vignette.

``` r library(sjtable2df) set.seed(1) dataset <- data.table::data.table( "var1" = sample( x = c("yes", "no"), size = 100, replace = TRUE, prob = c(.3, .7) ), "var2" = sample( x = c("yes", "no"), size = 100, replace = TRUE ) )

xtab <- sjPlot::tab_xtab( var.row = dataset$var1, var.col = dataset$var2, show.summary = TRUE, use.viewer = FALSE )

sjtable2df::xtab2df(xtab = xtab, output = "data.table")

> var1 var2 no var2 yes Total

> 1: no 29 39 68

> 2: yes 18 14 32

> 3: Total 47 53 100

> 4: χ2=1.116 · df=1 · φ=0.127 · p=0.291

sjtable2df::xtab2df(xtab = xtab, output = "kable", format = "latex")

> \begin{tabular}[t]{l|l|l|l}

> \hline

> var1 & var2 no & var2 yes & Total\

> \hline

> no & 29 & 39 & 68\

> \hline

> yes & 18 & 14 & 32\

> \hline

> Total & 47 & 53 & 100\

> \hline

> \multicolumn{4}{l}{\textsuperscript{} $χ2=1.116 · df=1 · φ=0.127 · p=0.291$}\

> \end{tabular}

```

More Information

Owner

  • Login: kapsner
  • Kind: user
  • Location: Erlangen, Germany

Medical Data Scientist.

GitHub Events

Total
  • Push event: 4
  • Create event: 1
Last Year
  • Push event: 4
  • Create event: 1

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 56
  • Total Committers: 2
  • Avg Commits per committer: 28.0
  • Development Distribution Score (DDS): 0.018
Past Year
  • Commits: 3
  • Committers: 1
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
kapsner l****r@w****e 55
Jonathan Mang 5****o 1

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 1
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 3 days
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 2.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • gidonc (1)
Pull Request Authors
  • joundso (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 300 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 3
  • Total maintainers: 1
cran.r-project.org: sjtable2df

Convert 'sjPlot' HTML-Tables to R 'data.frame'

  • Versions: 3
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 300 Last month
Rankings
Forks count: 21.9%
Stargazers count: 26.2%
Dependent packages count: 29.8%
Average: 31.8%
Dependent repos count: 35.5%
Downloads: 45.6%
Maintainers (1)
Last synced: 7 months ago

Dependencies

.github/workflows/coverage.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • pat-s/always-upload-cache main composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-tinytex v2 composite
.github/workflows/lint.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • pat-s/always-upload-cache main composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-tinytex v2 composite
.github/workflows/tic.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • actions/upload-artifact main composite
  • pat-s/always-upload-cache main composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-tinytex v2 composite
DESCRIPTION cran
  • R >= 2.10 depends
  • data.table * imports
  • kableExtra * imports
  • magrittr * imports
  • rlang * imports
  • rvest * imports
  • stats * imports
  • xml2 * imports
  • knitr * suggests
  • lintr * suggests
  • lme4 * suggests
  • mlbench * suggests
  • rmarkdown * suggests
  • sjPlot * suggests
  • testthat >= 3.0.1 suggests