我想编写trycatch代码来处理从网上下载时的错误.
url <- c(
"http://stat.ethz.ch/R-manual/R-devel/library/base/html/connections.html",
"http://en.wikipedia.org/wiki/Xz")
y <- mapply(readLines, con=url)
Run Code Online (Sandbox Code Playgroud)
这两个语句成功运行.下面,我创建一个不存在的Web地址:
url <- c("xxxxx", "http://en.wikipedia.org/wiki/Xz")
Run Code Online (Sandbox Code Playgroud)
url[1]不存在.如何编写trycatch循环(函数)以便: