# #——包括= FALSE ------------------------------------------------------------ 美元knitr: opts_chunk设置(eval = TRUE ) ## ----------------------------------------------------------------------------- dput (runif) set.seed (1001) runif (10 ) ## ----------------------------------------------------------------------------- " 用法:runif。R (n =
——最小值=
——max =
——种子=
] \ n \ noptions: \ n, n =
观察数。如果length(n) > 1,则取长度为所需的数字[default: 1]。\ n - min =
分布的下限。必须是有限的[default: 0]。\ n - max =
分布的上限。必须是有限的[default: 1]。\ n——种子=
set.seed()函数的种子1)”- >文档库(“docopt ") ## ----------------------------------------------------------------------------- docopt (doc) #没有提供argumetns docopt(医生,”——n 10 - min = 3 - max = 5 ") ## ----------------------------------------------------------------------------- 选择< - docopt (doc) set.seed(选择种子美元)runif (n = as.integer(选择$ n),最小值= as.numeric(选择最小美元),max = as.numeric(选择美元max ) ) ## ---- eval = FALSE -------------------------------------------------------------- # #!/usr/bin/Rscript # "R (n =
——最小值=
——max =
——种子=
] \ n \ noptions: \ n, n =
观察数。如果length(n) > 1,则取长度为所需的数字[default: 1]。\ n - min =
分布的下限。必须是有限的[default: 0]。\ n - max =
分布的上限。必须是有限的[default: 1]。\ n——种子=
种子set.seed()函数(默认值:1)”——> doc # #库(docopt) #选择< - docopt (doc) # set.seed(选择种子美元)# runif (# n = as.integer(选择$ n), #分钟= as.numeric(选择最小美元),# max = as.numeric(选择美元max ) # ) ## ---- eval = TRUE,发表评论 =''------------------------------------------------- fl < -系统。文件(“码头工人/ sevenbridges / src”、“runif2spin。R”、包= " sevenbridges”)猫(readline (fl), 9 = " \ n ") ## ----------------------------------------------------------------------------- 库(sevenbridges) fd < - fileDef (name = " runif。R", content = readr::read_file(fl)) rbx <- Tool(id = "runif", label = "runif", hints = requirements(docker(pull = "rocker/ R -base"), cpu(1), mem(2000)), requirements = requirements(fd), baseCommand = "Rscript runif. R")。R”,stdout = " output.txt ",输入=列表(输入(id =“数量”,类型=“整数”,位置= 1),输入(id =“分钟”,类型=“浮动”,位置= 2),输入(id =“max”类型=“浮动”,位置= 3)),输出=输出(id =“随机”,水珠= " output.txt ") ) ## ---- eval = TRUE,发表评论 =''------------------------------------------------- fl < -系统。文件(“码头工人/ sevenbridges / src”、“runif_args。R”、包= " sevenbridges”)猫(readline (fl), 9 = " \ n ") ## ----------------------------------------------------------------------------- fd < - fileDef (name = " runif。R", content = readr::read_file(fl)) rbx <- Tool(id = "runif", label = "runif", hints = requirements(docker(pull = "rocker/ R -base"), cpu(1), mem(2000)), requirements = requirements(fd), baseCommand = "Rscript runif. R")。R”,stdout = " output.txt ",输入=列表(输入(id =“数量”,类型=“整数”,单独的= FALSE,前缀=”——n = "),输入(id =“分钟”,类型=“浮动”,单独的= FALSE,前缀= " - min = "),输入(id =“max”类型=“浮动”,单独的= FALSE,前缀=”——max = ")),输出=输出(id =“随机”,水珠= " output.txt ") ) ## ---- eval = TRUE,发表评论 = ""----------------------------------------------- fl < -系统。文件(“码头工人/ sevenbridges / src”、“runif_args。R”、包= " sevenbridges”)猫(readline (fl), 9 = " \ n ") ## ----------------------------------------------------------------------------- fd < - fileDef (name = " runif。R", content = readr::read_file(fl)) rbx <- Tool(id = "runif", label = "runif", hints = requirements(docker(pull = "rocker/hadleyverse"), cpu(1), mem(2000)), requirements = requirements(fd), baseCommand = "Rscript -e \"rmarkdown::render(knitr::spin('runif. ')),R ', FALSE)) \”- - - args”,stdout =“output.txt”,输入=列表(输入(id =“数量”,类型=“整数”,单独的= FALSE,前缀=”——n = "),输入(id =“分钟”,类型=“浮动”,单独的= FALSE,前缀= " - min = "),输入(id =“max”类型=“浮动”,单独的= FALSE,前缀=”——max = ")),输出=列表(输出(id =“标准输出”,类型=“文件”,水珠=“output.txt”),输出(id =“随机”,类型=“文件”,水珠=“* . csv”),输出(id =“报告”,类型=“文件”, glob = "*.html") ) ) ## ---- eval = TRUE------------------------------------------------------------- fl <- system.file("docker/sevenbridges/src/", "runif.R", package = "sevenbridges") ## ---- comment='', eval = TRUE, echo = FALSE----------------------------------- cat(readLines(fl), sep = "\n") ## ---- comment='', eval = TRUE, echo = FALSE----------------------------------- fl <- system.file("docker/sevenbridges/report/", "report.Rmd", package = "sevenbridges") cat(readLines(fl), sep = "\n")