我有这样的代码:
analysisModules <-
list(
list(
module = "divosLongitudinal",
type = "RAW_DATA_TRELLIS",
displayName = "Raw Data Trellis"
),
...
)
for(module in analysisModules) {
tryCatch({
library(module$module, character.only = TRUE)
.analysisModules$analysisModule[[module$type]] <- module
}, error = function() {
print(paste("missing module", module$module))
})
}
我添加了tryCatch,因为某些模块可能会丢失,但是当我运行此代码时,我遇到了这个错误:
Listening on http://127.0.0.1:6541 Loading environments/devProfile.R
Warning: Error in value[[3L]]: unused argument (cond) Stack trace
(innermost first):
40: tryCatchOne
39: tryCatchList
38: tryCatch
37: server [C:\projects\divosshiny\inst\app/server.R#145]
1: runApp Error in value[[3L]](cond) : unused argument (cond)
第145行是tryCatch({
如何跳过未安装的软件包?