当前位置: 首页 > news >正文

个人网站带论坛 备案近期出现的病毒叫什么

个人网站带论坛 备案,近期出现的病毒叫什么,股票互动平台,大型网站建设定制shiny 能快速把R程序以web app的形式提供出来,方便使用,降低技术使用门槛。 本文提供的示例:把空格分隔的txt文件转为逗号分隔的csv文件。 前置依赖:需要有R环境(v4.2.0),安装shiny包(v1.9.1)。括号内是我使用的版本…

shiny 能快速把R程序以web app的形式提供出来,方便使用,降低技术使用门槛。

本文提供的示例:把空格分隔的txt文件转为逗号分隔的csv文件。

前置依赖:需要有R环境(v4.2.0),安装shiny包(v1.9.1)。括号内是我使用的版本。

install.packages(“shiny”)

1.运行与效果

  • 文件名:script/app3/app.R
  • 运行: > shiny::runApp(“script/app3/”)
  • 关闭:关闭浏览器。
  1. 左上角:上传文件,
  2. 右侧:预览效果
  3. 右下角:下载csv文件
    在这里插入图片描述

2.文件内容

script/app3/app.R 如下:

library(shiny)
library(bslib)# Define UI for slider demo app ----
ui <- page_sidebar(# App title ----title = "Blank space txt to csv | v0.0.1",# Sidebar panel for inputs ----sidebar = sidebar(# Input: Select a file ----fileInput("file1","Choose TXT File",multiple = TRUE,accept = c("text/csv","text/comma-separated-values,text/plain","text/blank-separated-values,text/plain",".csv")),tags$hr(),sliderInput("num","show number:",min = 2,max = 1000,value = 10),# Horizontal line ----tags$hr(),# Input: Checkbox if file has header ----checkboxInput("header", "Header", TRUE),# Input: Select separator ----radioButtons("sep","Separator",choices = c(Comma = ",",Semicolon = ";",Blank = " ",Tab = "\t"),selected = " "),# Input: Select quotes ----radioButtons("quote","Quote",choices = c(None = "","Double Quote" = '"',"Single Quote" = "'"),selected = ''),# Horizontal line ----tags$hr(),# Input: Select number of rows to display ----radioButtons("disp","Display",choices = c(Head = "head",All = "all"),selected = "head"),# ButtondownloadButton("downloadData", "Download csv")),# Output: Data file ----tableOutput("contents")
)# Define server logic to read selected file ----
server <- function(input, output) {output$contents <- renderTable({# input$file1 will be NULL initially. After the user selects# and uploads a file, head of that data file by default,# or all rows if selected, will be shown.req(input$file1)df <- read.csv(input$file1$datapath,header = input$header,sep = input$sep,quote = input$quote)if (input$disp == "head") {return(head(df, n=input$num))} else {return(df, n=input$num)}})# Downloadable csv of selected dataset ----output$downloadData <- downloadHandler(filename = function() {req(input$file1)paste(input$file1$datapath, ".csv", sep = "")},content = function(file) {req(input$file1)df <- read.csv(input$file1$datapath,header = input$header,sep = input$sep,quote = input$quote)write.csv(df, file, row.names = FALSE, quote=F)})
}if(0){# show blank separated txt file with headerrunApp("script/app3/")
}# Create Shiny app ----
shinyApp(ui, server)

Ref

  • https://shiny.posit.co/r/getstarted/shiny-basics/lesson1/

End

http://www.shuangfujiaoyu.com/news/37528.html

相关文章:

  • 红旗h5站长工具seo综合查询推广
  • 马鞍山网站建设黄冈seo
  • 做b2c网站还是平台微信推广费用一般多少
  • 做学校子网站石家庄网站建设就找
  • 网站建设毕业论文个人网站制作软件
  • 网站成本百度推广天天打骚扰电话
  • 中国设计师联盟网站贵州seo和网络推广
  • shopbase建站费用百度站长工具怎么用
  • 网站关键词seo优化怎么做营销型网站建设解决方案
  • 建设 信用中国 网站网站页面怎么优化
  • 富阳网站设计百度搜索引擎的特点
  • 注册网站域名要多少钱app代理推广平台
  • 合肥外贸网站建设公司排名网络营销技巧和营销方法
  • 大昌建设集团有限公司网站百度今日排行榜
  • edu网站一般谁做的网站备案查询
  • 沙坪坝做网站郑州seo软件
  • 上海周边网站建设360识图
  • 移动端网站教程seo网站推广如何做
  • 微表单网站网络营销方案设计毕业设计
  • 网站与app的区别最好的网站设计公司
  • wordpress-5.2.1谷歌seo服务商
  • 政务服务中心 网站建设宁德市人民政府
  • 网站制作需要多少钱新闻免费培训seo
  • 有网站想修改里面的内容怎么做谷歌搜索入口中文
  • 做推广哪个平台网站好企业邮箱怎么开通注册
  • 怎样免费做网站网球新闻最新消息
  • 设计商城的网站建设竞价关键词排名软件
  • 网站飘落怎么做怎么做百度推广
  • 单页网站seo独立站搭建要多少钱
  • 青岛易龙网站建设seo网站排名厂商定制