You should really use file.path and paste since it's fast and platform independent. (seealso tools::file_ext, tools::file_path_sans_ext), but below is a little function that is intended for Linux or Mac systems that might come in handy.  I don't use it very often because if I share my code, I either have to give the user this function or a personal package that contains it, so I usually end up editing the code to use file.path and it turns out to be less work to just not use this function to begin with.
> fpath(path, "filename", extension)
[1] "/path/to/directory/filename.txt"
#' create a filepath
#'
#' This just pastes together \code{dir} and \code{file} and optionally 
#' \code{ext}.  It is intended for Mac or Linux systems. 
#' @param dir character string of directory (with or without trailing slash)
#' @param file character string of filename (with or without extension)
#' @param ext Optional. character file extension. (with or without leading dot)
#' @return character string representing a filepath
#' @examples
#' fpath("path/to", "file", "csv")
#' fpath("path/to/", "file.csv", ".csv") 
#' #knows not to duplicatate the "/" or the ".csv"
#' fpath('path/to', 'file.csv')
#' fpath("file", ext="csv") #knows that dir is missing
#' fpath("", "file", "txt") # no leading forward slash if dir == ""
#' @export
fpath <- function(dir, file, ext) {
    lchar <- function(x) substr(x, nchar(x), nchar(x)) #last char of string
    fl <- if (missing(file)) {
      dir
    } else {
        if (missing(dir) || dir == "") {
            file
        } else {
            dir <- if (substr(dir, nchar(dir), nchar(dir)) != "/") { 
                paste(dir, "/", sep="") 
            } else dir
            file <- gsub("^/+", "", file) # remove leading forward slashes from file names
            paste(dir, file, sep="")
            #TODO: should figure out how to throw an error (or allow it to work) if called like 
            #      fpath("ftp:/", "/ftp.domain.com") or fpath('http:/', '/www.domain.com')
        }
    }
    if (lchar(fl) == "/") stop("'file' should not end with a forward slash")
    if (!missing(ext)) {
        ext <- if (substr(ext, 1, 1) != ".") {
            paste(".", ext, sep="")
        } else ext
        if (substr(fl, nchar(fl) - nchar(ext) + 1, nchar(fl)) != ext) {
            fl <- paste(fl, ext, sep="")
        }
    }
    fl
}