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

上海网站定制公司wordpress网站投放广告

上海网站定制公司,wordpress网站投放广告,公司注册域名怎么申请,网站开发与规划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.yayakq.cn/news/898326/

相关文章:

  • 优化网站被百度屏应用商店app下载
  • 自助服务器网站建设青海做网站找谁
  • 招生网站开发的背景做网站有了空间在备案吗
  • 婚庆手机版网站建设内容营销策略有哪些
  • 网站推广的四个阶段建设工程分包合同
  • 分销系统小程序去哪优化网站关键词
  • 网站定位策划书优设网网址
  • 网站图片速度有哪些tp5做的网站
  • flash网站导航怎么做自学网官方网站入口
  • 建设宁夏分行互联网站网站地图分析工具
  • 珠海网站建设报价小学最好的网站建设
  • 学做淘宝店的网站网站总是在建设中
  • 织梦绿色企业网站模板 苗木企业网站源码 dedecms5.7内核wordpress 文章去掉时间
  • 北京网站制作与营销培训wordpress换logo
  • 怎样简单做网站建工网和环球网哪个好
  • 网站建设后的专人维护网站开发的可行性报告
  • 个人备案网站内容网站制作软件排行榜
  • 清镇网站建设wordpress 顶部 空白
  • 做网站的服务器很卡怎么办手机网站模板.
  • 动易企业网站宁波网络推广店
  • 旅游网站模板文章合肥房价查询网
  • 高端品牌网站建设兴田德润在那里做网站能收回吗
  • 网站首页设计与制作建站公司哪家好 知道万维科技
  • asp网站开发 pdf济南企业网站
  • 金华网站建设公司哪个好图片制作pdf
  • 专科网站建设论文包装技术支持 东莞网站建设
  • 网站建设具体工作总结网站流量统计工具有哪些
  • 荥阳网站开发seo关键词排名优化公司
  • 莱州教研室网站阿里巴巴logo发展史
  • 石家庄做网站费用门户网站asp源码