@@ -11,53 +11,53 @@ not_null <- Negate(is.null)
1111
1212not_na <- Negate(is.na )
1313
14- # ' Removes the null from a vector
15- # '
16- # ' @noRd
17- # '
18- # ' @example
19- # ' drop_nulls(list(1, NULL, 2))
20- drop_nulls <- function (x ) {
21- x [! sapply(x , is.null )]
22- }
23-
24- # ' If x is `NULL`, return y, otherwise return x
25- # '
26- # ' @param x,y Two elements to test, one potentially `NULL`
27- # '
28- # ' @noRd
29- # '
30- # ' @examples
31- # ' NULL %||% 1
32- " %||%" <- function (x , y ) {
33- if (is.null(x )) {
34- y
35- } else {
36- x
37- }
38- }
39-
40- # ' If x is `NA`, return y, otherwise return x
41- # '
42- # ' @param x,y Two elements to test, one potentially `NA`
43- # '
44- # ' @noRd
45- # '
46- # ' @examples
47- # ' NA %|NA|% 1
48- " %|NA|%" <- function (x , y ) {
49- if (is.na(x )) {
50- y
51- } else {
52- x
53- }
54- }
55-
56- # ' Typing reactiveValues is too long
57- # '
58- # ' @inheritParams reactiveValues
59- # ' @inheritParams reactiveValuesToList
60- # '
61- # ' @noRd
62- rv <- function (... ) shiny :: reactiveValues(... )
63- rvtl <- function (... ) shiny :: reactiveValuesToList(... )
14+ # ' #' Removes the null from a vector
15+ # ' #'
16+ # ' #' @noRd
17+ # ' #'
18+ # ' #' @example
19+ # ' #' drop_nulls(list(1, NULL, 2))
20+ # ' drop_nulls <- function(x) {
21+ # ' x[!sapply(x, is.null)]
22+ # ' }
23+ # '
24+ # ' #' If x is `NULL`, return y, otherwise return x
25+ # ' #'
26+ # ' #' @param x,y Two elements to test, one potentially `NULL`
27+ # ' #'
28+ # ' #' @noRd
29+ # ' #'
30+ # ' #' @examples
31+ # ' #' NULL %||% 1
32+ # ' "%||%" <- function(x, y) {
33+ # ' if (is.null(x)) {
34+ # ' y
35+ # ' } else {
36+ # ' x
37+ # ' }
38+ # ' }
39+ # '
40+ # ' #' If x is `NA`, return y, otherwise return x
41+ # ' #'
42+ # ' #' @param x,y Two elements to test, one potentially `NA`
43+ # ' #'
44+ # ' #' @noRd
45+ # ' #'
46+ # ' #' @examples
47+ # ' #' NA %|NA|% 1
48+ # ' "%|NA|%" <- function(x, y) {
49+ # ' if (is.na(x)) {
50+ # ' y
51+ # ' } else {
52+ # ' x
53+ # ' }
54+ # ' }
55+ # '
56+ # ' #' Typing reactiveValues is too long
57+ # ' #'
58+ # ' #' @inheritParams reactiveValues
59+ # ' #' @inheritParams reactiveValuesToList
60+ # ' #'
61+ # ' #' @noRd
62+ # ' rv <- function(...) shiny::reactiveValues(...)
63+ # ' rvtl <- function(...) shiny::reactiveValuesToList(...)
0 commit comments