前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >部署ShinyApp

部署ShinyApp

原创
作者头像
生信探索
发布2023-03-25 12:00:38
3210
发布2023-03-25 12:00:38
举报
文章被收录于专栏:生信探索生信探索

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

克隆

代码语言:text
复制
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

代码语言:text
复制
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和密钥

代码语言:text
复制
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/ 可以访问了

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 克隆
  • UI
  • 部署
相关产品与服务
数据库一体机 TData
数据库一体机 TData 是融合了高性能计算、热插拔闪存、Infiniband 网络、RDMA 远程直接存取数据的数据库解决方案,为用户提供高可用、易扩展、高性能的数据库服务,适用于 OLAP、 OLTP 以及混合负载等各种应用场景下的极限性能需求,支持 Oracle、SQL Server、MySQL 和 PostgreSQL 等各种主流数据库。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档