点击查看代码
tryCatch(libray(xx),warning = function(w){print("出现警告")},
               error=function(e){print("出现错误")},
               finally={
                 print("导入ggplot2包")
                 library(ggplot2)
               }
)
posted on 2023-05-25 17:16  Bonjour_!  阅读(67)  评论(0)    收藏  举报