-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
194 lines (169 loc) · 8.44 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
---
title: "README"
output:
md_document:
variant: markdown_github
params:
NVIpkg: "NVIcheckmate"
pkg_path: !r usethis::proj_path()
first_copyright_year: "2021"
---
```{r, include = FALSE}
NVIpkg <- params$NVIpkg
NVIpkg_inline <- paste0("`", NVIpkg, "`")
logo_path <- ""
if (file.exists(paste0("./man/figures/", NVIpkg, "_logo.png"))) {
logo_path <- paste0(' <img src="man/figures/', NVIpkg, '_logo.png" align="right" height="138" />')
}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
`r paste0(NVIpkg, ": ", desc::desc_get_field(key = "Title"), logo_path)`
================
<!-- README.md is generated from README.Rmd. Please edit that file -->
- [Overview](#overview)
- [Installation](#installation)
- [Usage](#usage)
- [Copyright and license](#copyright-and-license)
- [Contributing](#contributing)
# Overview
`NVIcheckmate` extends [`checkmate`](https://CRAN.R-project.org/package=checkmate)
with functions for argument checking that are adapted for NVIverse.
```{r, include = FALSE}
description <- desc::desc_get_field(key = "Description")
```
```{r child=system.file('templates', "README_NVIverse.Rmd", package = "NVIpackager")}
```
The main purpose of `NVIcheckmate` is to provide checks and assertions for functions
in `NVIverse` in the case that the checks and assertions are not available in `checkmate`.
These include specialized argument checking as well as checking other requirements
like if a package is installed, if the users credentials are available and, if an
valid ODBC-channel exists.
In addition, an argument for adding a custom message is included in selected assertions
from `checkmate`. Thereby, the error messages for a specific function may be explained
to provide more meaningful error messages.
`NVIcheckmate` is intended for use together with `checkmate`. `NVIcheckmate` intend
to follow the same principles as `checkmate` concerning input and error messages.
The argument checking in `NVIverse` uses the assert class in `checkmate` for
collecting and reporting the assertions, and assertions from `checkmate` and
`NVIcheckmate` are combined when checking the arguments of a function.
When and if functionality covered by `NVIcheckmate` are included in `checkmate`
as available at Cran, the corresponding function will be depreciated and thereafter
removed from `NVIcheckmate`.
# Installation
```{r child=system.file('templates', "README_installation.Rmd", package = "NVIpackager")}
```
# Usage
```{r child=system.file('templates', "README_usage_attach.Rmd", package = "NVIpackager")}
```
`r paste0(NVIpkg_inline,
"",
sub(substr(description,1,1), tolower(substr(description,1,1)), description))`
```{r child=system.file('templates', "README_usage_help.Rmd", package = "NVIpackager")}
```
# Copyright and license
#### NVIcheckmate
```{r child=system.file('templates', "README_copyright_and_license.Rmd", package = "NVIpackager")}
```
Functions and code from `checkmate` have been imported into `NVIcheckmate`. For some of
them, the code have been partly modified. An overwiew of the functional modifications are
given in Table 2. In addition, some technical changes like escaping character, changing
links and correcting typos have been performed. The modifications are listed in the respective
source files. Code from `checkmate` are the copyright of the copyright holders of `checkmate`.
#### checkmate
Copyright (c) 2019 - 2022 Michael Lang (michellang@@gmail.com)
License: BSD 3-Clause
#### Table 2. Functions and code imported from `checkmate`
```{r echo = FALSE, results = 'asis'}
imports <- as.data.frame(rbind(c("assert.R",
"./R",
"Combines multiple checks into one assertion",
"Includes the argument 'comment'"),
c("mstopOrPush",
"./R",
"Internal function. Located in file assert.R",
"None"),
c("mstop",
"./R",
"Internal function. Located in file helper.R",
"None"),
c("makeAssertFunction.R",
"./R",
"Creates an assertion function from a check function",
"Adds the argument 'comment' when creating an assertion function"),
c("assert_character",
"./R",
"Check if an argument is a vector of type character",
"Based on checkCharacter and includes the argument 'comment'"),
c("assert_data_frame",
"./R",
"Check if an argument is a data frame",
"Based on check_data_frame and includes the argument 'comment'"),
c("assert_disjunct",
"./R",
"Check if an argument is a vector of type character",
"Based on checkDisjunct and includes the argument 'comment'"),
c("assert_integer",
"./R",
"Check if an argument is a vector of type integer",
"Based on checkInteger and includes the argument 'comment'"),
c("assert_integerish",
"./R",
"Check if an argument is a vector of type intergish",
"Based on checkIntegerish and includes the argument 'comment'"),
c("assert_names",
"./R",
"Perform various checks on character vectors, usually names",
"Based on checkNames and includes the argument 'comment'"),
c("assert.R",
"./man-roxygen",
"help template",
"None"),
c("bounds.R",
"./man-roxygen",
"help template",
"None"),
c("checker.R",
"./man-roxygen",
"help template",
"Only included information on check_- and assert_-functions, the rest were removed"),
c("fmatch.R",
"./man-roxygen",
"help template",
"None"),
c("makeFunction.R",
"./man-roxygen",
"help template",
"None"),
c("na-handling.R",
"./man-roxygen",
"help template",
"None"),
c("null.ok.R",
"./man-roxygen",
"help template",
"None"),
c("sorted.R",
"./man-roxygen",
"help template",
"None"),
c("typed.missing.R",
"./man-roxygen",
"help template",
"None"),
c("x.R",
"./man-roxygen",
"help template",
"None")))
colnames(imports) <- c("Function", "Directory", "Description", "Modification")
knitr::kable(x = imports, col.names = c("Function", "Directory", "Description", "Functional modifications"))
```
# Contributing
```{r child=system.file('templates', "README_contributing.Rmd", package = "NVIpackager")}
```
<!-- Code of conduct -->
-----
```{r child=system.file('templates', "README_code_of_conduct.Rmd", package = "NVIpackager")}
```