File: getTypeStrings.R

package info (click to toggle)
r-cran-paramhelpers 1.14.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 992 kB
  • sloc: ansic: 102; sh: 13; makefile: 2
file content (59 lines) | stat: -rw-r--r-- 1,200 bytes parent folder | download | duplicates (3)
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
#' @title Get parameter type-strings.
#' @description
#' Returns type strings used in `param$type` for certain groups of parameters.
#' @template arg_include_int
#' @template arg_include_logical
#' @return [`character`].
#' @name getTypeStrings
#' @rdname getTypeStrings
NULL

#' @export
#' @rdname getTypeStrings
getTypeStringsAll = function() {
  ph$type.strings
}

#' @export
#' @rdname getTypeStrings
getTypeStringsNumeric = function(include.int = TRUE) {
  if (include.int) {
    ph$type.strings.numeric
  } else {
    ph$type.strings.double
  }
}

#' @export
#' @rdname getTypeStrings
getTypeStringsNumericStrict = function() {
  ph$type.strings.double
}

#' @export
#' @rdname getTypeStrings
getTypeStringsInteger = function() {
  ph$type.strings.integer
}

#' @export
#' @rdname getTypeStrings
getTypeStringsCharacter = function() {
  ph$type.strings.character
}

#' @export
#' @rdname getTypeStrings
getTypeStringsDiscrete = function(include.logical = TRUE) {
  if (include.logical) {
    c(ph$type.strings.discrete, ph$type.strings.logical)
  } else {
    ph$type.strings.discrete
  }
}

#' @export
#' @rdname getTypeStrings
getTypeStringsLogical = function() {
  ph$type.strings.logical
}