R用于读取多个csv(tsv)文件的进度条

R用于读取多个csv(tsv)文件的进度条,r,R,是否有任何方法显示用于导入多个csv文件的进度条。 以下是进口代码: 列出所有要导入的领域: temp <- list.files(pattern="*\\.tsv$") temp test_data <- lapply(temp,function(x){ read.csv(file = x, sep ="\t", fill = TRUE, quote='', header = FALS

是否有任何方法显示用于导入多个csv文件的进度条。 以下是进口代码: 列出所有要导入的领域:

temp <- list.files(pattern="*\\.tsv$") 
temp
test_data <- lapply(temp,function(x){
  read.csv(file = x,
           sep ="\t",
           fill = TRUE,
           quote='', 
           header = FALSE 
  )[ ,c(287, 288, 289, 290, 291, 292, 293, 304, 370, 661, 662, 812, 813,994, 995, 1002)]
}
)

temp您可以通过
progress
库实现这一点:

library(progress)                                                      # add
temp <- list.files(pattern="*\\.tsv$") 
pb <- progress_bar$new(format = " progress [:bar] :percent eta: :eta", # add
                       total = length(temp), clear = FALSE, width= 60) # add
test_data <- lapply(temp,function(x){
  pb$tick()                                                            # add
  read.csv(file = x,
           sep ="\t",
           fill = TRUE,
           quote='', 
           header = FALSE 
  )[ ,c(287, 288, 289, 290, 291, 292, 293, 304, 370, 661, 662, 812, 813,994, 995, 1002)]
})
library(progress)#添加

temp您可以通过
progress
库实现这一点:

library(progress)                                                      # add
temp <- list.files(pattern="*\\.tsv$") 
pb <- progress_bar$new(format = " progress [:bar] :percent eta: :eta", # add
                       total = length(temp), clear = FALSE, width= 60) # add
test_data <- lapply(temp,function(x){
  pb$tick()                                                            # add
  read.csv(file = x,
           sep ="\t",
           fill = TRUE,
           quote='', 
           header = FALSE 
  )[ ,c(287, 288, 289, 290, 291, 292, 293, 304, 370, 661, 662, 812, 813,994, 995, 1002)]
})
library(progress)#添加

readr
程序包中读取的temp
read\u csv
将为您提供一个进度条。在readr::read\u csv(file=x,sep=“\t”,fill=TRUE,quote=“”,:unbenutzte Argumente(未使用的参数)(sep=“\t”,fill=TRUE,header=FALSE)中获取读取csv:Fehler的错误消息
read_csv
的参数不同,但看起来您找到了答案。
readr
包中的
read_csv
将为您提供一个进度条。在readr::read_csv(file=x,sep=“\t”,fill=TRUE,quote=“”,:unbenutzte Argumente(未使用的参数)(sep=“\t”)中获取了read_csv:Fehler的错误消息,fill=TRUE,header=FALSE)对于
read_csv
,参数是不同的,但看起来您找到了答案。警告与您的区域设置相关,而不是与进度条相关,您的案例中的临时长度是多少?警告与您的区域设置相关,而不是与进度条相关,您的案例中的临时长度是多少?