Shiny

使用 R 轻松进行交互的 Web 应用程序。「Easy interactive web applications with R」

Github stars Tracking Chart

Shiny(闪亮)

Shiny 是来自 RStudio 的一个新包,它使得用 R 构建交互式 web 应用程序变得非常容易

有关介绍和示例,请访问 Shiny Dev Center

如果您对使用 Shiny 有疑问,请使用 RStudio社区网站。有关错误报告,请使用 问题跟踪器

特性

  • 只需要几行代码就可以构建有用的 web 应用程序,不需要 JavaScript。
  • Shiny 的应用程序是自动"live"的,就像电子表格一样。用户修改输入时,输出会立即更改,而无需重新加载浏览器。
  • Shiny 的用户界面可以完全使用R构建,也可以直接用 HTML、CSS 和 JavaScript 编写,以获得更大的灵活性
  • 适用于任何 R 环境((控制台 R,适用于 Windows 或 Mac 的 Rgui,ESS,StatET,RStudio 等)。
  • 基于 Bootstrap 的有吸引力的默认 UI 主题。
  • 高度可定制的滑块小部件,内置对动画的支持。
  • 预建的输出小部件,用于显示 R 对象的图、表和打印输出。
  • 使用 httpuv 软件包的 Web 浏览器和 R 之间的快速双向通信。
  • 使用reactive(反应式)编程模型,消除了混乱的事件处理代码,因此您可以关注真正重要的代码。
  • 开发和重新分发自己的 Shiny 小部件,其他开发人员可以轻松地将其放入自己的应用程序中(即将推出!)。

安装

要从 CRAN 安装稳定版本,只需从 R 控制台运行以下内容

install.packages("shiny")

要直接从GitHub安装最新的开发版本,请运行这个

if (!require("remotes"))
  install.packages("remotes")
remotes::install_github("rstudio/shiny")

入门

要了解更多信息,我们强烈建议您查看 Shiny Tutorial。该教程深入解释了该框架,引导您构建一个简单的应用程序,并包括大量带注释的示例。

Bootstrap 3 迁移

shiny 的 0.10.2.2 及更低版本使用了 Bootstrap 2 Web 框架。在 0.10.2.2 之后, Shiny 切换到 Bootstrap3。对于大多数用户而言,升级应该是无缝的。但是,如果您已自定义 HTM L生成代码以使用特定于 Bootstrap 2 的功能,则可能需要更新代码以与 Bootstrap 3 配合使用。

如果您此时不希望更新代码,则可以使用 shinybootstrap2 软件包以实现向后兼容。

如果您希望安装较旧版本的 Shiny,可以使用 devtools 软件包进行安装:

devtools::install_version("shiny", version = "0.10.2.2")

开发须知

使用在 Node.js 上运行的工具可以缩小 Shiny 中的 Javascript 代码。有关更多信息,请参见 tools/ 目录。

贡献准则

我们欢迎为 shiny 包做出贡献。请参阅我们的 CONTRIBUTING.md 文件以获取有关捐款的详细指导。

许可

这个 shiny 的包作为一个整体是在 GPLv3 下授权的。有关更多细节,请参阅 许可文件

(The first version translated by vz on 2020.06.24)

Overview

Name With Ownerrstudio/shiny
Primary LanguageR
Program languageR (Language Count: 6)
PlatformLinux, Mac, Windows
License:Other
Release Count72
Last Release Namev1.8.1.1 (Posted on )
First Release Namerubyesque (Posted on )
Created At2012-06-20 18:45:11
Pushed At2024-05-06 20:31:24
Last Commit At
Stargazers Count5.3k
Watchers Count337
Fork Count1.9k
Commits Count6k
Has Issues Enabled
Issues Count2597
Issue Open Count770
Pull Requests Count1142
Pull Requests Open Count65
Pull Requests Close Count228
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Shiny

Travis: Travis Build Status

AppVeyor: AppVeyor Build Status

Shiny is a new package from RStudio that makes it incredibly easy to build interactive web applications with R.

For an introduction and examples, visit the Shiny Dev Center.

If you have general questions about using Shiny, please use the RStudio Community website. For bug reports, please use the issue tracker.

Features

  • Build useful web applications with only a few lines of code—no JavaScript required.
  • Shiny applications are automatically "live" in the same way that spreadsheets are live. Outputs change instantly as users modify inputs, without requiring a reload of the browser.
  • Shiny user interfaces can be built entirely using R, or can be written directly in HTML, CSS, and JavaScript for more flexibility.
  • Works in any R environment (Console R, Rgui for Windows or Mac, ESS, StatET, RStudio, etc.).
  • Attractive default UI theme based on Bootstrap.
  • A highly customizable slider widget with built-in support for animation.
  • Prebuilt output widgets for displaying plots, tables, and printed output of R objects.
  • Fast bidirectional communication between the web browser and R using the httpuv package.
  • Uses a reactive programming model that eliminates messy event handling code, so you can focus on the code that really matters.
  • Develop and redistribute your own Shiny widgets that other developers can easily drop into their own applications (coming soon!).

Installation

To install the stable version from CRAN, simply run the following from an R console:

install.packages("shiny")

To install the latest development builds directly from GitHub, run this instead:

if (!require("devtools"))
  install.packages("devtools")
devtools::install_github("rstudio/shiny")

Getting Started

To learn more we highly recommend you check out the Shiny Tutorial. The tutorial explains the framework in-depth, walks you through building a simple application, and includes extensive annotated examples.

Bootstrap 3 migration

Shiny versions 0.10.2.2 and below used the Bootstrap 2 web framework. After 0.10.2.2, Shiny switched to Bootstrap 3. For most users, the upgrade should be seamless. However, if you have have customized your HTML-generating code to use features specific to Bootstrap 2, you may need to update your code to work with Bootstrap 3.

If you do not wish to update your code at this time, you can use the shinybootstrap2 package for backward compatibility.

If you prefer to install an older version of Shiny, you can do it using the devtools package:

devtools::install_version("shiny", version = "0.10.2.2")

Development notes

The Javascript code in Shiny is minified using tools that run on Node.js. See the tools/ directory for more information.

Guidelines for contributing

We welcome contributions to the shiny package. Please see our CONTRIBUTING.md file for detailed guidelines of how to contribute.

License

The shiny package as a whole is licensed under the GPLv3. See the LICENSE file for more details.

To the top