R/cache.name.R

Defines functions cache.name

Documented in cache.name

#' Translate a variable name into a file name for caching.
#'
#' This function will translate a variable name into a form that is
#' suitable as a filename on most OS's.
#'
#' @param data.filename The variable name to be translated into a filename.
#'
#' @return A translated variable name.
#'
#' @keywords internal
#'
#' @examples
#' library('ProjectTemplate')
#'
#' \dontrun{cache.name('example.1')}
cache.name <- function(data.filename)
{
  return(gsub('\\..*', '', data.filename, perl = TRUE))
}

Try the ProjectTemplate package in your browser

Any scripts or data that you put into this service are public.

ProjectTemplate documentation built on Nov. 20, 2023, 1:06 a.m.