1
make_call <- function(...) {
2 0
  as.call(list(...))
3
}
4

5
vlapply <- function(X, FUN, ..., FUN.VALUE = logical(1)) {
6 1
  vapply(X, FUN, ..., FUN.VALUE = FUN.VALUE)
7
}
8

9
names2 <- function(x) {
10 1
  nms <- names(x)
11 1
  if (is.null(nms)) {
12 1
    rep("", length(x))
13
  } else {
14 1
    nms[is.na(nms)] <- ""
15 1
    nms
16
  }
17
}
18

19
#' Shim for tools::makevars_user()
20
#' @keywords internal
21
#' @export
22
makevars_user <- function() {
23 0
  if (getRversion() >= "3.3") {
24 0
    return(tools::makevars_user())
25
  }
26
  # Below is tools::makevars_user() from R 3.6.2
27 0
  m <- character()
28 0
  if (.Platform$OS.type == "windows") {
29 0
    if (!is.na(f <- Sys.getenv("R_MAKEVARS_USER", NA_character_))) {
30 0
      if (file.exists(f))
31 0
        m <- f
32
    }
33 0
    else if ((Sys.getenv("R_ARCH") == "/x64") && file.exists(f <- path.expand("~/.R/Makevars.win64")))
34 0
      m <- f
35 0
    else if (file.exists(f <- path.expand("~/.R/Makevars.win")))
36 0
      m <- f
37 0
    else if (file.exists(f <- path.expand("~/.R/Makevars")))
38 0
      m <- f
39
  }
40
  else {
41 0
    if (!is.na(f <- Sys.getenv("R_MAKEVARS_USER", NA_character_))) {
42 0
      if (file.exists(f))
43 0
        m <- f
44
    }
45 0
    else if (file.exists(f <- path.expand(paste0("~/.R/Makevars-",
46 0
            Sys.getenv("R_PLATFORM")))))
47 0
      m <- f
48 0
    else if (file.exists(f <- path.expand("~/.R/Makevars")))
49 0
      m <- f
50
  }
51 0
  m
52
}
53

54
as_character <- function(x) {
55 1
  nms <- names(x)
56 1
  res <- as.character(x)
57 1
  names(res) <- nms
58 1
  res
59
}

Read our documentation on viewing source code .

Loading