R/path_expand.2.R

#' Swap / for \\ in path expand
#' @param x file path, could be relative or ~
#' @return Full filepath to x
#' @details See path.expand() in base R
#' @export
path.expand.2 <- function(x){
  
  # Swap / for \\ in path expand
  
  temp <- path.expand(x)
  
  temp <- gsub("/~$","",temp)
  
  out <- gsub("\\\\","/",temp)
  
  return(out)
  
}
gelfondjal/IT2 documentation built on May 17, 2019, 12:15 a.m.