Save Data Frame to qs File in a Specified Directory
here_save_qs.Rd
Saves the provided data frame as a `.qs` file using the specified name, within a directory defined by `dir_path`. This function leverages the `qs` package to write data frames to `.qs` format for efficient storage and quick access in R.
Arguments
- df
Data frame to be saved. This is the object you want to persist to disk in `.qs` format.
- name
Character string specifying the base name of the file (without the ".qs" extension).
- dir_path
Character string specifying the directory path where the file will be saved.
Value
Invisible NULL. The primary effect of this function is the side effect of writing a `.qs` file to disk.
Details
The `dir_path` argument must point to an existing directory. The function does not create directories; it assumes that the specified directory already exists.
Examples
my_df <- data.frame(x = 1:5, y = letters[1:5])
here_save_qs(my_df, "my_saved_dataframe", "~/mydata")
#> Error in qs::qsave(df, here::here(dir_path, paste0(name, ".qs"))): For file ~/mydata/my_saved_dataframe.qs: Failed to open for writing. Does the directory exist? Do you have file permissions? Is the file name long? (>255 chars)