diff --git a/R/save-to-file.R b/R/save-to-file.R new file mode 100644 index 0000000..526a9f0 --- /dev/null +++ b/R/save-to-file.R @@ -0,0 +1,14 @@ +#' Save data to CSV. +#' +#' @param data Survey data. +#' @param path Path where data should be saved to. +#' +#' @return Save a CSV file, returns tibble invisibly. +#' @export +#' +save_as_csv <- function(data, path) { + fs::dir_create(fs::path_dir(path)) + data |> + readr::write_csv(here::here(path)) + path +} diff --git a/R/utils.R b/R/utils.R index 1202a93..258ab0a 100644 --- a/R/utils.R +++ b/R/utils.R @@ -10,21 +10,6 @@ #' @return A logical vector. NULL -#' Save data to CSV. -#' -#' @param data Survey data. -#' @param path Path where data should be saved to. -#' -#' @return Save a CSV file, returns tibble invisibly. -#' @export -#' -save_as_csv <- function(data, path) { - fs::dir_create(fs::path_dir(path)) - data |> - readr::write_csv(here::here(path)) - path -} - #' Assign the version of the course that the survey response comes from. #' #' @param date The date of the survey response.