Skip to content

Commit

Permalink
chore: move code into it's own file
Browse files Browse the repository at this point in the history
  • Loading branch information
lwjohnst86 committed Mar 15, 2024
1 parent f0ce6ea commit ce54117
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
14 changes: 14 additions & 0 deletions R/save-to-file.R
Original file line number Diff line number Diff line change
@@ -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
}
15 changes: 0 additions & 15 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ce54117

Please sign in to comment.