parseFilenames: parse sensorgnome filenames into components

Description Usage Arguments Value Note

View source: R/parseFilenames.R

Description

parse sensorgnome filenames into components

Usage

1
parseFilenames(f, base = basename(f), checkDOS = TRUE)

Arguments

f

character vector of filenames with full path

base

character vector of file basenames; these default to basename(f), but will differ when the basename has been corrected (e.g. to remove invalid UTF-8 sequences).

checkDOS

if TRUE, the default, try to correct DOS 8.3-style filenames; if FALSE, return NA for rows corresponding to these.

Value

a dataframe of components, with one row per filename and these columns:

  1. prefix: human readable short site name

  2. serno: receiver serial number; "SG-" followed by 12 alphanumeric characters e.g. 1315BBBK2156, or possibly with an appended "_N" where N is 1, 2, ... for disentangling serial number collisions. Alphabetic characters are converted to upper case.

  3. bootnum: boot count (integer)

  4. tsString: timestamp in YYYY-MM-DDTHH-MM-SS.SSSS format

  5. ts: timestamp embedded in name (double, with class c("POSIXt", "POSIXct") )

  6. tsCode: timestamp code ('P' means before GPS fix, 'Z' means accurate to 1e-6 s, 'Y' to 1e-5s, 'X' to 1e-4s, ..., 'T' to 1s)

  7. port: character; port label, if this file is associated with a single port (e.g. a .WAV file); "all" if all ports

  8. extension: character extension of uncompressed file; e.g. ".txt"; lower case

  9. comp: character; file compression type, if any: "", or ".gz"; lower case

Note

:


jbrzusto/motusServer documentation built on May 19, 2019, 8:19 a.m.