Skip to contents

dta_get_datasets() copies a dataset from the code installation to a specified file path. If no path is provided, it saves the file as dta-data.xlsx in the current working directory.

Usage

dta_get_datasets(copy_to_file_path = NULL)

Arguments

copy_to_file_path

A string specifying the file path where the dataset should be copied. If NULL (default), the dataset will be copied to dta-data.xlsx in the current working directory.

Value

The function does not return a value. It prints a success message if the operation is successful or throws an error if it fails.

Details

The function uses file.copy() to copy the file specified by dta_path() to the destination path. The destination path can be provided as an argument, or it defaults to dta-data.xlsx in the current working directory.

Examples

# Copy to the default location
# dta_get_datasets()