0
我想使用tryCatch循環一個函數,我知道會產生錯誤,但我不能得到正確的錯誤語法。使用TryCatch在一個循環bnets
xcount <- 1
while(xcount < 11){
xvar <- as.character(x[,xcount])
yvar <- as.character(x[,xcount+1])
bn <- set.arc(bn, xvar, yvar)
for(bn in 1:11){
tryCatch({
plot(bn)
score(bn, foo)
error= function(e)
print('error')})}