R/loadRDa.R

Defines functions loadRDa

Documented in loadRDa

#' load .RDa file into new object name
#'
#' @description Loads .rda and .rdata files with the ability to assign them to a new object name instead of the one they were originally saved with.
#'
#' @param fileName The file path to a .rda or .rdata file to be loaded into a new object name
#' @export
#'
#' @examples \dontrun{
#' new_name <- loadRDa("filepath/file.rda")
#' }
#'
loadRDa <- function(fileName){
  #loads an RData file, and returns it
  load(fileName)
  get(ls()[ls() != "fileName"])
}
jpetrovich02/CCMHr documentation built on Jan. 25, 2024, 11:57 p.m.