tests/testthat/helper-urls.R

to_file_url <- function(path) {
  stopifnot(file.exists(path))
  norm <- normalizePath(path, winslash = "/", mustWork = TRUE)
  encoded <- utils::URLencode(norm)
  if (.Platform$OS.type == "windows") {
    paste0("file:///", encoded)   # file:///C:/...
  } else {
    paste0("file://", encoded)    # file:///tmp/...
  }
}

Try the writeAlizer package in your browser

Any scripts or data that you put into this service are public.

writeAlizer documentation built on Sept. 17, 2026, 1:08 a.m.