From bf6eb237dbf99ea768dc1c521eae60fef1eab6fc Mon Sep 17 00:00:00 2001 From: Ming Yang Date: Thu, 4 Jul 2024 20:08:34 +0800 Subject: [PATCH] Update package README --- README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index bac7a34..1199129 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,24 @@ -# Data Loading Module - -[![Checks 🧩](https://github.com/Boehringer-Ingelheim/dv.loader/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Boehringer-Ingelheim/dv.loader/actions/workflows/ci.yml) +# Data Loading + +The {dv.loader} package provides a simple interface for loading data from a network file storage folder or +locally. It is designed to be used with `.RDS` and `.sas7bdat` file formats. +The package provides a simple function, `load_data()`, which loads R and SAS data files into memory. +Loading data from SQL databases is not yet supported. The function returns a list named by the file names passed, +and containing data frames, along with metadata for that table. By default, the function will look for files in a +sub-directory `sub_dir` of the base path defined by a environment variable "RXD_DATA". You can check if the base path +is set by running `Sys.getenv("RXD_DATA")`. A single file or multiple files can be loaded at once. +To make the loading process faster for large datasets, it is suggested that '.sas7bdat' files are converted to +'.RDS' files. The function will prefer '.RDS' files over '.sas7bdat' files by default. ## Installation ```r -install.packages("devtools") # if you have not installed "devtools" package -devtools::install_github("Boehringer-Ingelheim/dv.loader") +if (!require("remotes")) install.packages("remotes") +remotes::install_github("Boehringer-Ingelheim/dv.loader") ``` ## Basic usage -**Note**: `dv.loader` is only designed to be used with `.RDS` and `.sas7bdat` file formats. - ```r # getting data from a network file storage folder dv.loader::load_data(sub_dir = "subdir1/subdir2", file_names = c("adsl", "adae")) @@ -20,9 +26,5 @@ dv.loader::load_data(sub_dir = "subdir1/subdir2", file_names = c("adsl", "adae") ```r # getting data locally (e.g., if you have file `./data/adsl.RDS`) -dv.loader::load_data(sub_dir = "data", file_names = c("adsl"), use_wd = T) +dv.loader::load_data(sub_dir = "data", file_names = c("adsl"), use_wd = TRUE) ``` - -## Contact - -If you have edits or suggestions, please open a PR.