美文网首页
rstudio后台运行命令

rstudio后台运行命令

作者: 可能性之兽 | 来源:发表于2022-12-31 15:37 被阅读0次

有些命令想要在rstudio的后台而不是一直丢在前台console那里就可以用这个包,这样就可以做其他事情

install.packages("job")
remotes::install_github("lindeloev/job")
image.png

最简单方式

job::job({
  foo = 10
  bar = rnorm(5)
})

经典方式

# Do light processing in the main session
### install.packages("brms")
library(brms)
data = mtcars[mtcars$hp > 100, ]
model1 = mpg ~ hp * wt
model2 = mpg ~ hp + wt

# Send long-running code to job(s).
job::job({
  fit1 = brm(model1, data)
})
job::job({
  fit2 = brm(model2, data)
})

# Continue working in your console
cat("I'm free now! Thank you.
    Sincerely, Console.")

用在安装依赖又长又多的R包是最好的啦

job::job({
  
  BiocManager::install("clusterProfiler")
})


job::job({
if(! require("devtools")) install.packages("devtools")
if(! require("reshape2")) install.packages("reshape2")
if(! require("ggplot2")) install.packages("ggplot2")
if(! require("pheatmap")) install.packages("pheatmap")
if(! require("ggfortify")) install.packages("ggfortify")
if(! require("stringr")) install.packages("stringr")
if(! require("survival")) install.packages("survival")
if(! require("survminer")) install.packages("survminer")
if(! require("lars")) install.packages("lars")
if(! require("glmnet")) install.packages("glmnet")
if(! require("timeROC")) install.packages("timeROC")
if(! require("ggpubr")) install.packages("ggpubr")
if(! require("randomForest")) install.packages("randomForest")
if(! require("ROCR")) install.packages("ROCR") 
if(! require("Hmisc")) install.packages("Hmisc")
if(! require("caret")) install.packages("caret")
# if(! require("genefilter")) install.packages("genefilter")
if(! require("ggstatsplot")) install.packages("ggstatsplot")
if(! require("Seurat")) install.packages("Seurat")
if(! require("SeuratObject")) install.packages("SeuratObject")


if(! require("tableone")) install.packages("tableone")

if(! require("rJava")) install.packages("rJava")
if(require('rJava')){
  # https://cran.r-project.org/src/contrib/Archive/ReporteRs/
  if(! require("ReporteRs")) install.packages("ReporteRs")
  devtools::install_github('davidgohel/ReporteRsjars')
  devtools::install_github('davidgohel/ReporteRs')
}
library(devtools) 


library('BiocInstaller')
if(! require('edgeR')){
  BiocManager::install(c('airway','DESeq2','edgeR','limma'))
}
if(! require("CLL")) BiocManager::install("CLL")
if(! require("org.Hs.eg.db")) BiocManager::installe('org.Hs.eg.db')
library(BiocInstaller)

if(! require("maftools")) BiocManager::install("maftools")
if(! require("RTCGA")) BiocManager::install("RTCGA")
if(! require("RTCGA.clinical")) BiocManager::install("RTCGA.clinical")

if(! require("RTCGA.miRNASeq")) BiocManager::install("RTCGA.miRNASeq")
if(! require("maftools")) BiocManager::install("maftools")
if(! require("genefilter")) BiocManager::install("genefilter")
})

image.png

lindeloev/job: job: free Your RStudio Console (github.com)

相关文章

  • rstudio后台运行命令

    有些命令想要在rstudio的后台而不是一直丢在前台console那里就可以用这个包,这样就可以做其他事情 最简单...

  • RStudio后台运行任务

    RStudio 的1.1.463 是支持32位Windows系统的最后一个版本,在升级到1.2版本之后,除了只能在...

  • R语言——Rstudio入门和基本概念

    Rstudio简介 1 Console窗口 命令窗口,可以使用命令行运行命令,每条命令运行的结果。命令窗口的最上边...

  • 后台不挂载运行

    命令:nohup 运行程序命令 & nohup : 不挂载运行 & : 后台运行

  • 转录组分析 1下载文件

    常识 1、关于命令的后台运行 & : 指在后台运行。nohup : 不挂断的运行。就是指,用nohup运行命令可以...

  • Linux命令后台运行

    Linux后台运行命令有两种方式: cmd & : 后台运行,关掉终端会停止运行 nohup cmd & : 后台...

  • linux shell多进程

    1 bash后台运行实现多进程 1.1 command & 后台运行 释放终端命令行,将command命令程序挂到...

  • Linux后台运行程序与指定输出文件

    作者:Gakki 后台启动运行 linux 后台运行命令有两种方式:cmd &:后台运行,关掉终端会停止运行noh...

  • 系统服务

    后台任务 &可以在命令运行时就让其在后台运行,其是运行状态ctrl + z 可以将命令放至后台,其是停止状态job...

  • 2019-04-09 程序前后台切换、挂机后继续运行的方法

    后台运行程序: 1. 直接后台运行: [shell命令] & 2. 运行中转入后台: 先用ctrl+z挂起任务...

网友评论

      本文标题:rstudio后台运行命令

      本文链接:https://www.haomeiwen.com/subject/fhhqcdtx.html