The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Path validation

We can easily set global path validation using on_path_not_exists and on_validate_path functions.

old.options <- options()

path.chain + logger: handling errors

library(path.chain)
library(logger)

log_level(ERROR)
log_appender(appender_console)
on_path_not_exists(~ log_error("Path {.x} not exists"))

level2.b <- path_link("fileA.RData")
level2.a <- path_link("fileB.fst")
level1   <- path_link("data", list(level2.a = level2.a , level2.b = level2.b))
root     <- path_link("files", list(level1))
root$data$level2.a
#> [1] "files/data/fileB.fst"

on_path_not_exists(NULL)

root$data$level2.a
#> [1] "files/data/fileB.fst"

Check path correctness

In some cases, path may even exists, being in the same time unsuitable for our purposes. on_validate_path function was created exactly to handle such cases.

is_path_valid <- function(x) if (!grepl("\\.fst", x)) print("Invalid file")
on_validate_path(is_path_valid)

root$data$level2.a
#> [1] "files/data/fileB.fst"
root$data$level2.b
#> [1] "Invalid file"
#> [1] "files/data/fileA.RData"
options(old.options)

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.