R包shiny开发网页--10.bs4Dash框架
2019-01-11 本文已影响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()