/usr/share/doc/r-cran-r.utils/tests/isUrl.R is in r-cran-r.utils 2.6.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | library("R.utils")
urls <- c(
"http://www.r-project.org/",
"ftp://cran.r-project.org/",
"htttp://www.r-project.org/", ## typo, but still a URL
"", ## empty
NA_character_ ## missing
)
print(urls)
res <- sapply(urls, FUN=isUrl)
print(res)
res <- isUrl(urls)
print(res)
stopifnot(is.logical(res))
stopifnot(length(res) == length(urls))
stopifnot(!any(is.na(res)))
|