Skip to contents

Returns TRUE if the given string starts with a recognised URL scheme, FALSE otherwise. Convenience wrapper around the internal .detectInputType() helper.

Usage

isURL(x)

Arguments

x

character(1) - the string to test.

Value

logical(1) - TRUE if x is a URL, FALSE otherwise.

See also

For the complementary check on an existing path, see isFilePath().

Other file.path: buildPath(), fileExistURL(), findDownload(), isFilePath(), splitPath()

Examples

isURL("https://example.com/data.csv")   # TRUE
#> [1] TRUE
isURL("ftp://files.example.org/x.zip")  # TRUE
#> [1] TRUE
isURL("s3://my-bucket/file.parquet")    # TRUE
#> [1] TRUE
isURL("/home/user/file.csv")            # FALSE
#> [1] FALSE
isURL("./script.R")                     # FALSE
#> [1] FALSE