使用 R Shiny 包进行一个简单的网页布局

14 篇文章 0 订阅

网页布局效果

在这里插入图片描述

代码

library(shiny)

ui <- fluidPage(
    titlePanel("My Shiny App"),
    
    sidebarLayout(
        sidebarPanel(
            tags$hgroup(
                h1("Installation"),
                h6("Shiny is availabel on CRAN, so you can install it in the usual way from your R console:"),
                code("install.packages(\"shiny\")"),
                br(),
                br(),
                br(),
                br(),
                img(src = "rstudio.png", height = 70, width = 180),
                h6("Shiny is a product of ", span("RStudio", style = "color:blue"))
            )
        ),
        
        mainPanel(
            h1("Introducing Shiny"),
            p("Shiny is a new package from RStudio that makes it ", em("incredibly easy"), " to build interactive web applications with R."),
            br(),
            p("For an introduction and live examples, visit the ", a(href="https://shiny.rstudio.com/", "Shiny homepage.")),
            br(),
            h1("Features"),
            p("- Build useful web applications with only a few lines of code -- no JavaScript required."),
            p("- Shiny applications are automatically 'live' in the same way that ", strong("spreadsheets"), "are live. Outputs change instantly as users modify inputs, without requiring a reload of the browser.")
        )
    )
)

server <- function(input, output){
}


shinyApp(ui = ui, server = server)


参考文章

1.「R shiny 基础」如何进行网页布局
2. LESSON 2:Build a user interface

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值