Check.File: Checking if a file already exists

View source: R/Checks.R

Check.FileR Documentation

Checking if a file already exists

Description

If a file already exists in a given place, load that file

Usage

Check.File(FName, Dir = getwd(), loadFun, load = TRUE, verbose = TRUE)

Arguments

FName

File name

Dir

Directory where to look for file

loadFun

function with which to load filetype of FName

load

Logical. Whether to load the data or not

verbose

Logical. Whether to print/message function progress in console or not.

Value

Either a data object or NULL

Examples

KrigR::Check.File(
  FName = basename(system.file("extdata", "CentralNorway.nc", package = "KrigR")),
  Dir = dirname(system.file("extdata", "CentralNorway.nc", package = "KrigR")),
  loadFun = terra::rast
)

ErikKusch/KrigR documentation built on Feb. 17, 2025, 2:09 p.m.