美文网首页shiny
R包shiny开发网页--10.bs4Dash框架

R包shiny开发网页--10.bs4Dash框架

作者: 小洁忘了怎么分身 | 来源:发表于2019-01-11 23:17 被阅读67次

这个包可以作为shiny的辅助,是18年刚开发的,目前基本没有中文教程,看下他的结构:
cran页面:https://cran.r-project.org/web/packages/bs4Dash/index.html
github:https://github.com/RinteRface/bs4Dash

1.空框架

if(!require(bs4Dash))install.packages("bs4Dash")
library(shiny)
library(bs4Dash)

 shiny::shinyApp(
   ui = bs4DashPage(
    navbar = bs4DashNavbar(),
    sidebar = bs4DashSidebar(),
    controlbar = bs4DashControlbar(),
    footer = bs4DashFooter(),
    title = "Basic Dashboard",
    body = bs4DashBody()
   ),
   server = function(input, output) {}
 )

示例网页是这样的:

if(!require(fontawesome))devtools::install_github("rstudio/fontawesome")
if(!require(shinyWidgets))install.packages("shinyWidgets")
if(!require(bs4Dash))install.packages("bs4Dash")
if(!require(plotly))install.packages("plotly")
library(shiny)
library(fontawesome)
library(shinyWidgets)
library(bs4Dash)
library(plotly)

bs4DashGallery()

相关文章

网友评论

    本文标题:R包shiny开发网页--10.bs4Dash框架

    本文链接:https://www.haomeiwen.com/subject/pzafdqtx.html