R/utils.R

last_char <- function(x) {
 
  n <- nchar(x)
  
  x <- substr(x, n, n)
  return(x)
   
}


fig_path <- function(x) {

y <- if (last_char(x) == '/') {
  
  file.path(x)
  
} else {
  
  file.path(paste0(x,'/'))
  
}

return(y)

}
ivyleavedtoadflax/rmd2md documentation built on May 18, 2019, 7:14 a.m.