getable

HTML Tables with Dynamic Data in R Markdown

https://github.com/liao961120/getable

Science Score: 13.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
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.6%) to scientific vocabulary

Keywords

javascript r r-package rmarkdown
Last synced: 9 months ago · JSON representation

Repository

HTML Tables with Dynamic Data in R Markdown

Basic Info
Statistics
  • Stars: 16
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
javascript r r-package rmarkdown
Created almost 6 years ago · Last pushed over 5 years ago
Metadata Files
Readme License

README.md

GETable

Support R
Version License:
MIT <!-- badges: end -->

GETable lets you insert dynamic HTML tables in R Markdown documents. "Dynamic" in the sense that the data are not hard-coded into output HTML documents but are requested from Google Spreadsheets or hosted JSON/CSV files when the user visit the web page. This mean that you can update the data without recompiling the .Rmd document!

GETable Demo

Installation

getable is now on CRAN, which can be installed with:

r install.packages("getable")

or, install the latest version from GitHub:

r remotes::install_github("liao961120/getable")

Usage

getable comes with a template that you can import in RStudio by selecting: File > New File > R Markdown > From Template > HTML Tables with Dynamic Data {GETable}.

Or, you can simply run the command below in the R console:

r rmarkdown::draft("name_your_file.Rmd", template = "tablefromweb", package = "getable")

The template contains several files, of which dfFromWeb.html, dfFromWeb.js, and dfFromWeb.css are required for the compiled HTML to work properly (DO NOT change the RELATIVE PATHs between these files and the source Rmd). Note that you can style the appearance of the HTML tables with CSS in dfFromWeb.css, and if you know a lot about JS, you can even modify the code in dfFromWeb.js to use other JS libraries to generate the HTML tables. You can see a working example here.

Inserting Tables

Simply use the function renderTable("<URL>") in a code chunk to insert a dynamic HTML table:

````rmd

title: "Inserting dynamic HTML tables" output: html_document: includes:

in_header: dfFromWeb.html # Needed to work properly

{r} getable::renderTable("https://yongfu.name/getable/demo/data/df.csv") ````

Under the hood

GETable uses JavaScript to asynchronously request data from a web server. You can host your data on the web, for example, in a Google Spreadsheet, in a GitHub repo, or on static site services such as GitHub Pages and Netlify.

Owner

  • Name: Yongfu Liao
  • Login: liao961120
  • Kind: user
  • Location: Taipei, Taiwan
  • Company: National Taiwan University

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: about 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total 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
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
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 246 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: getable

Fetching Tabular Data "Onload" in Compiled R Markdown HTML Documents

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 246 Last month
Rankings
Stargazers count: 13.3%
Forks count: 28.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Average: 37.4%
Downloads: 79.7%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.4.0 depends
  • knitr * imports
  • jsonlite * suggests
  • rmarkdown * suggests