R/save_csv.R

Defines functions save_csv

Documented in save_csv

#' Save a .csv file representation of an R object with the object name
#'
#' Uses "write.csv" with presets to save a .csv of an object and uses the
#' object's name to name the .csv file.
#'
#' @param object the object to save.
#' @keywords export, save, csv
#' @export
#' @examples
#' test <- 1:10
#' save_csv(test)

save_csv <-
  function(object) {
    write.csv(object,
              paste0(
                deparse(substitute(object)),
                ".csv"
              )
    )
  }
mtcruz/mtcruzr documentation built on Dec. 26, 2019, 11:04 p.m.