百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

dashR

> 前端框架
开源

在 R 中创建数据科学和 AI Web 应用

390 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

在 R 中创建数据科学和 AI Web 应用

Dash for R

Create beautiful, analytic web applications in R.

Documentation | Gallery

Installation

Make sure you're on at least version 3.0.2 of R. You can see what version of R you have by entering version in the R CLI. CRAN is the easiest place to download the latest R version.

As of 2020-06-04, dash and the currently released versions of all core component libraries are available for download via CRAN! Installing dash and its dependencies is as simple as

r
install.packages("dash")

Users who wish to install (stable) development versions of the package as well as Dash components from GitHub may instead use install_github and specify the development branch:

r
install.packages(c("fiery", "routr", "reqres", "htmltools", "base64enc", "plotly", "mime", "crayon", "devtools"))

# installs dash, which includes dashHtmlComponents, dashCoreComponents, and dashTable
# and will update the component libraries when a new package is released
devtools::install_github("plotly/dashR", ref="dev", upgrade = TRUE)

Then, to load the packages in R:

r
library(dash)

That's it!

Getting Started

The R package dash makes it easy to create reactive web applications powered by R. It provides an R6 class, named Dash, which may be initialized via the new() method.

r
library(dash)

app %
  set_layout(
    dccInput(id = "text", "sample"),
    div("CAPS: ", span(id = "out1")),
    div("small: ", span(id = "out2"))
  ) %>%
  add_callback(
    list(
      output("out1", "children"),
      output("out2", "children")
    ),
    input("text", "value"),
    function(text) {
      list(
        toupper(text),
        tolower(text)
      )
    }
  ) %>%
  run_app()

Here the showcase = TRUE argument opens a browser window and automatically loads the Dash app for you.

Hello world example using dccGraph

r
library(dash)

# Create a Dash app
app % set_layout(
  h1('Hello Dash'),
  div("Dash: A web application framework for your data."),
  dccGraph(
    figure = list(
      data = list(
        list(
          x = list(1, 2, 3),
          y = list(4, 1, 2),
          type = 'bar',
          name = 'SF'
        ),
        list(
          x = list(1, 2, 3),
          y = list(2, 4, 5),
          type = 'bar',
          name = 'Montr\U{00E9}al'
        )
      ),
      layout = list(title = 'Dash Data Visualization')
    )
  )
)

# Run the app
app %>% run_app()

Screenshot of "Hello World" app

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScriptdashdata-sciencedata-visualizationplotly

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架