Shiny是Rstudio开发的一款基于R的app编程产品。本文分为两个部分:
- 用shiny快速建立一个个人页面app
- 上传app使其他设备能够访问
1. 建立个人页面app
由于不涉及交互功能,shiny app的代码会非常简单:
library(shiny)
library(shinydashboard)
ui<-dashboardPage(
dashboardHeader(title = em(h3(strong('SignpostR'))),
titleWidth = 300),
dashboardSidebar(width = 300,
sidebarMenu(
menuItem(strong("About"), tabName = 'homepage', icon = icon('home')),
menuItem(strong('Examples in Zhihu'), tabName = 'gallery', icon = icon('book'),
menuSubItem(p('ggplot2'), tabName = 'Ggexample'),
menuSubItem(p('Data treatments'), tabName = 'Dtreat'))
)),
dashboardBody(
tabItems(
tabItem(tabName = 'homepage',
fluidPage(
box(
title = h3(strong('Avocado (:)O)=')),
width = 200,
column(
img(src="headme.png",
height = 300, width = 250),
width = 5
),
column(
h3(strong('Resume')),
p('Ph.D in a school in Wu'daokou, Beijing'),
p('E-mail: wu0h962003@msn.com'),
h3(strong('Articles in Zhihu')),
a(h4("R语言工具路标"),href="https://zhuanlan.zhihu.com/c_1197516359964143616"),