R/isFilePath.R

Defines functions isFilePath

Documented in isFilePath

#' @title Check if an input is a valid path
#' @description A simple check if an input corresponds to a valid path to a file
#' @param x input
#' @return \code{TRUE} if \code{x} is a valid path, \code{FALSE} otherwise
#' @author Waldir Leoncio
isFilePath <- function(x) {
  isFP <- FALSE
  try(
    expr = {
      normalizePath(x, mustWork = TRUE)
      isFP <- TRUE
    },
    silent = TRUE
  )
  return(isFP)
}

Try the matlab2r package in your browser

Any scripts or data that you put into this service are public.

matlab2r documentation built on Feb. 16, 2023, 10:39 p.m.