From 4dc5e4d849030835e35c97e0fdf0a6d2460ee898 Mon Sep 17 00:00:00 2001 From: Flippie Coetser Date: Sun, 1 Oct 2023 08:24:54 -0700 Subject: [PATCH] INITIAL --- DESCRIPTION | 6 ++-- README.md | 72 +----------------------------------------------- tests/testthat.R | 12 ++------ 3 files changed, 6 insertions(+), 84 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 9f67fa1..f0eea5a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ -Package: R.Template -Title: Package Tile +Package: Validate +Title: Generic Validations Version: 0.0.1.0000 Authors@R: person(given = "Flippie", @@ -7,7 +7,7 @@ Authors@R: role = c("aut", "cre"), email = "Flippie.Coetser@gmail.com", comment = c(ORCID = "0000-0003-0549-9245")) -Description: Packge Description. +Description: Generic set of Validations and Exceptions used by most packages. License: file LICENSE Encoding: UTF-8 LazyData: true diff --git a/README.md b/README.md index 1d6f818..a145ba1 100644 --- a/README.md +++ b/README.md @@ -1,71 +1 @@ -# R Package Template - -This repository can be used as a boilerplate when creating a new R package. It contains a basic package structure and a few valuable files to get started. - -Unique feature included in this template: - -1. A basic unit testing framework using `testthat`. -2. A basic documentation framework using `roxygen2`. -3. Github Actions for CI/CD. - -## Using Template - -To use this template to create your own R-Package, follow these steps: - -1. R `devtools` is required when developing R packages. Install and Reboot: - -```r -install.packages("devtools") -``` - -2. Install the unit testing framework `testthat`: - -```r -install.packages("testthat") -``` - -3. Create new Repository: click the `Use this template` button to create a new repository. - -4. Clone Repository - -```bash -git clone -``` - -5. Update `README.md` -6. Update `DESCRIPTION` -7. Update `tests/testthat/testthat.R`: change the reference in `library()` and `test_check()` with your package name. -8. Update documentation using `devtools` in r terminal - -```r -devtools::document() -``` - -7. Check the Package using `devtools` in r terminal - -```r -devtools::check() -``` - -## Template Architecture - -### Folder Structure - -By design, R packages leverage a specific folder structure. This structure is used by `devtools` to document, check and build packages. -Here is an overview of the different files and folders that comprise the package structure. - -Files: - -- `DESCRIPTION`: Contains the package metadata. This file defines the package name, version, dependencies and other metadata. -- `NAMESPACE`: Contains the package namespace. This file is used to define the package exports and imports. -- `LICENSE`: Contains the package license. This file is used to define the package license. -- `README.md`: Contains the package readme. This file is used to provide a high-level overview of the package. - -Folders: - -- `man`: Contains the documentation files. These files are generated by `devtools` and should not be edited manually. -- `R`: Contains the R source code files. These files define the functions and data structures that make up the package. -- `tests`: Contains the unit tests. These files test the functions and data structures that make up the package. -- `vignettes`: Contains the vignettes. These files are used to provide additional documentation and examples. - -Most of your time developing R packages will be spent in the R and Tests folders. Files in `man` and `vignettes` are generated by `devtools` and should not be edited manually. Also, the contents in the `NAMESPACE` file should not be edited manually. +# Validate diff --git a/tests/testthat.R b/tests/testthat.R index b04cee6..5bd4541 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,12 +1,4 @@ -# This file is part of the standard setup for testthat. -# It is recommended that you do not modify it. -# -# Where should you do additional test configuration? -# Learn more about the roles of various files in: -# * https://r-pkgs.org/tests.html -# * https://testthat.r-lib.org/reference/test_package.html#special-files - library(testthat) -library(R.Template) +library(Validate) -test_check("R.Template") +test_check("Validate")