raw.updateID: Assigns a Unique ID to each RAW Data File

View source: R/raw.updateID.R

raw.updateIDR Documentation

Assigns a Unique ID to each RAW Data File

Description

Finds all RAW files and assigns a unique ID. Once the ID is assigned, it is immutable; each file is identified by its CRC check sum, code and file size, so not by the file name; if the file name or location has changed, the ID will remain the same, but the file name is updated. Some meta data with paths to RAW data is stored as header information, currently located at the end of the file.

Usage

raw.updateID(
  pRAW = "",
  pRESULTS = "data-raw",
  idFile = "RAW-ID.csv",
  f_post = NA,
  forceRegenerate = FALSE,
  fixDuplicates = FALSE,
  removeIDs = c(),
  noData = FALSE,
  verbose = TRUE
)

Arguments

pRAW

path with raw data, if missing, then will prompt for path

pRESULTS

path for results, default: uses pRAW

idFile

name of file with IDs, default: RAW-ID.csv

f_post

function to customize sample, type etc.

forceRegenerate

logical, regenerate file, use with great care only

fixDuplicates

logical, if TRUE, duplicates are removed, use with care only

removeIDs

CAUTION: will delete IDs listed as vector

noData

logical, if TRUE, returns RAW ID file name otherwise RAW data

verbose

logical, if TRUE outputs information about the process

Value

returns TRUE if name has a valid format

Possible scenarios

(rule 1)

RAW ID file does not exist and must be generated

(rule 2)

new RAW file is added,

(rule 3)

RAW file is missing,

(rule 4)

RAW file has duplicate in different folder,

(rule 5)

RAW file has duplicate with new name,

(rule 6)

RAW file moved to a different folder, and folder needs update

See Also

raw.getFileByID, raw.getIDbyFile

Examples

## Not run: 
  raw.updateID()

## End(Not run)

thomasgredig/RAWdataR documentation built on Nov. 6, 2024, 9:46 a.m.