Learn R Programming

phenology (version 4.0.4)

local.search: Return path of file searched for in local disk based on its file name

Description

Return path of file searched for in local disk based on its file name. It has been tested only with Windows XP and MacOSX.

Usage

local.search(pattern, directory = "", folder = "$HOME", intern = TRUE,
  ignore.stdout = FALSE, ignore.stderr = TRUE)

Arguments

pattern
The name of file to be searched for. Can use wildcards *
directory
The path of directory to be explored in for Windows
folder
The path of folder to be explored in for Unix based systems
intern
A logical (not NA) which indicates whether to capture the output of the command as an R character vector (see system()).
ignore.stdout
a logical (not NA) indicating whether messages written to 'stdout' should be ignored (see system()).
ignore.stderr
a logical (not NA) indicating whether messages written to 'stderr' should be ignored (see system()).

Value

  • A vector with paths

Details

local.search() returns path of file serached in local disk based on its file name

Examples

Run this code
RnwFiles <- local.search("*.Rnw")
nc.files <- local.search("*.nc", folder=paste0("'",getwd(),"'"))

Run the code above in your browser using DataLab