Sunday 24 September 2017

File path issues in R using Windows (“Hex digits in character string” error)

Cited from File path issues in R using Windows (“Hex digits in character string” error)

pathPrep <- function(path = "clipboard") {
    y <- if (path == "clipboard") {
        readClipboard()
    } else {
        cat("Please enter the path:\n\n")
        readline()
    }
    x <- chartr("\\", "/", y)
    writeClipboard(x)
    return(x)
}

No comments:

Post a Comment