Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

HTML Tables with Dynamic Data in R Markdown

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
NotificationsYou must be signed in to change notification settings

liao961120/getable

Repository files navigation

Support R VersionLicense: MIT

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 fromGoogle Spreadsheets orhosted 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:

install.packages("getable")

or, install the latest version from GitHub:

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:

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

The template contains several files, of whichdfFromWeb.html,dfFromWeb.js, anddfFromWeb.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 indfFromWeb.css, and if you know a lot about JS, you can even modify the code indfFromWeb.js to use other JS libraries to generate the HTML tables. You can see a working examplehere.

Inserting Tables

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

---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 aGoogle Spreadsheet, in aGitHub repo, or on static site services such asGitHub Pages andNetlify.

About

HTML Tables with Dynamic Data in R Markdown

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp