Skip to contents

Reads a `.qs` file specified by `name` from a directory defined by `dir_path`, returning the data frame stored within. This function uses the `qs` package to efficiently read `.qs` files and the `here` package to construct the file path in a consistent, platform-independent manner.

Usage

here_read_qs(name, dir_path)

Arguments

name

Character string specifying the name of the `.qs` file to be read (without the ".qs" extension).

dir_path

Character string specifying the directory path from which the file will be read.

Value

A data frame representing the data stored in the specified `.qs` file.

Details

The `dir_path` argument must point to an existing directory. The function will throw an error if the specified file does not exist or cannot be read as a `.qs` file.

Examples

 if (FALSE) {
# Assuming you have a directory path "~/mydata"
# and you have previously saved a `.qs` file named "my_dataset.qs" in that directory
my_df <- here_read_qs("my_dataset", "~/mydata")
}