部署ShinyApp

需求:更新网页中的gitlab仓库网址和邮箱

克隆

git clone https://gitlab.com/BioQuest/CESA.git

tree CESA

# CESA

# ├── LICENSE

# ├── README.md

# ├── rsconnect

# │  └── shinyapps.io

# │      └── bioquest

# │          └── cesa.dcf

# ├── server.R

# ├── ui.R

# └── www

#    └── source.R

# 5 directories, 6 files

UI

library(shiny)

library(readr)

options(encoding="UTF-8")

# Define UI for application that draws a histogram

source('www/source.R')

shinyUI(fluidPage(

    tags$style("@import url(https://use.fontawesome.com/releases/v6.0.0/css/all.css);"),

    tags$style(

        ".p1,.p2,.p3 {

      color: #3b6089;

    }"

    ),

    # Sidebar

    sidebarLayout(

        sidebarPanel(

           

            p(class = "p1","Please paste your data below, which contains one dataframe of three colums, ",tags$b('days,'),tags$b('group1,'),tags$b('group2.')),

            tags$br(),

            p(class = "p2","You can use customed header, and the second column name will be the file name of download."),

            p(class = "p3","You may run the sample file as shown in text box."),

            actionButton(inputId = "Run",label = "Run",width="90%",icon=icon("person-running",verify_fa = FALSE)),

            tags$br(),

            tags$br(),

            downloadButton("downspss",label='Download SPSS',width="30%"),

            downloadButton("downtable",label='Download Table',width="30%"),

            downloadButton("downplot",label='Download Plot',width="30%"),

            tags$br(),

            textAreaInput("file5", "", value=Text,width="90%",height = "400px",

                          cols=3,rows = 100,resize = "both",placeholder=Text),

            tags$div(

                tags$h5('Author: Victor'),

                tags$h5("Email: Victor@BioQuest.cn"),

                tags$a(href="https://BioQuest.cn", "Website: BioQuest.cn"),

                tags$a(href="https://gitlab.com/BioQuest/CESA", "Source Code"))

        ),

        mainPanel(

            tags$h1(tags$em("Caenorhabditis elegans"),"survival analysis"),

            tags$hr(),

            tableOutput(outputId='table1'),

            tags$p(tags$b('meanse:'),"mean ± SEM, ", tags$b('pv:'),"p-value, ", tags$b('PLC:'),"percent life span change, ", tags$b('N:'),"number of each group"),

            plotOutput("plot1",

                      width = "50%",

                      height = "500px"),

            hr(),

))))

部署

获取token和密钥


install.packages("rsconnect")

library(rsconnect)

rsconnect::setAccountInfo(name='bioquest', token='XXXXXX', secret='XXXXXX/XXXXXX')

deployApp()

# Preparing to deploy application...Update application currently deployed at

# https://bioquest.shinyapps.io/cesa/? [Y/n] Y

# DONE

# Preparing to deploy application...DONE

# Uploading bundle for application: 8612139...DONE

# Deploying bundle: 6980026 for application: 8612139 ...

# Waiting for task: 1283408108

#  building: Building image: 8278782

#  building: Fetching packages

#  building: Installing packages

#  building: Installing files

#  building: Pushing image: 8278782

#  deploying: Starting instances

#  success: Stopping old instances

# Application successfully deployed to https://bioquest.shinyapps.io/cesa/

https://bioquest.shinyapps.io/cesa/ 可以访问了

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    wgl0419阅读 6,323评论 1 9
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,859评论 18 139
  • 用到的组件 1、通过CocoaPods安装 2、第三方类库安装 3、第三方服务 友盟社会化分享组件 友盟用户反馈 ...
    SunnyLeong阅读 14,651评论 1 180
  • w3school关于标签的解析 http://www.w3school.com.cn/tags/ 一、body 二...
    liboxiang阅读 1,857评论 0 0
  • C++ 开源库列表https://en.cppreference.com/w/cpp/links/libs[htt...
    老陕西阅读 2,171评论 0 0