R/utils.R

Defines functions rscript_path package_file default_socket

Documented in default_socket package_file rscript_path

#' Path to Rscript.exe (on Windows)
#'
#' @param arch architecture: "i386" for 32 bit or "x64" for 64 bit
#' @return absolute file path to "Rscript.exe"
#'
rscript_path <- function(arch = "i386")
{
  match.arg(arch, c("i386", "x64"))

  file.path(R.home(), "bin", arch, "Rscript.exe")
}

#' Path to File in This Package
#'
#' @param \dots passed to \code{\link{system.file}}
#' @param mustWork passed to \code{\link{system.file}}
#' @return absolute file path to a file in the installation folder of this
#'   package
#'
package_file <- function(..., mustWork = FALSE)
{
  system.file(..., package = "odbc32", mustWork = mustWork)
}

#' Default Socket
#'
#' Currently, this is just a shortcut to \code{.GlobalEnv$.r2r_socket}
#'
default_socket <- function()
{
  .GlobalEnv$.r2r_socket
}
vh-d/odbc32 documentation built on Dec. 25, 2019, 8:47 p.m.