抑制 R 中的进度条

And*_*ndy 4 r progress-bar

R的eHOF包中的HOF函数会自动生成进度条。函数中没有关闭进度条的参数。

有什么办法可以抑制函数外的进度条的生成?(我正在应用该功能数百次,目前进度条除了淹没我的屏幕外没有任何作用。)

And*_*ndy 8

根据@hrbrmstr 的建议。

# Load the library
library("eHOF")

# Generate a fake dataset
FakeData<-sample(c(0,1),250,replace=TRUE)
TestMatrix<-matrix(FakeData,nrow=50,ncol=5)

# Apply the HOF function to each column of the matrix, and suppress progbar
# Use invisible to prevent capture.output from printing the progbar
invisible(capture.output(Models<-apply(TestMatrix,2,HOF,1:50)))

# Apply the Para function to extract the model parameters
DesiredOutcome<-sapply(Models,Para)
Run Code Online (Sandbox Code Playgroud)