vrl2csv: Convert Vemco VRL file(s) to CSV format (detection data only)

View source: R/util-vrl2csv.r

vrl2csvR Documentation

Convert Vemco VRL file(s) to CSV format (detection data only)

Description

Convert detection data from a VEMCO VRL file(s) to comma-separated-values (CSV) format by invoking a system command in VUE (> 2.06; courtesy of Tim Stone, Vemco).

Usage

vrl2csv(vrl, outDir = NA, overwrite = TRUE, vueExePath = NA)

Arguments

vrl

A character string or vector with names of VRL file(s) or a single directory containing VRL files.

outDir

A character string directory where CSV files will be written. If NA (default) then file(s) will be written to the current working directory (e.g., getwd()).

overwrite

Logical. If TRUE (default), output CSV file(s) will overwrite existing CSV file(s) with same name in outDir. When FALSE, '_n' (i.e., _1, _2, etc.) will be appended to names of output files that already exist in outDir.

vueExePath

An optional character string with directory containing VUE.exe. If NA (default) then the path to VUE.exe must be added to the PATH environment variable of your system. See Note below.

Details

If vrl is a directory, then all VRL files in that directory will be converted to CSV. Otherwise, only those files specified in vrl will be converted. Each output CSV file will have same name as its source VRL file.

Value

A character vector with output directory and file name(s).

Note

Receiver event data are not exported because that functionality was not supported by the VUE system command at time of writing.

The path to VUE.exe must either be specified by vueExePath or added to the PATH environment variable of your system. To get the path to VUE.exe in Windows, right click on the icon, select "Properties", and then copy text in "Target" box.

To create a CSV for time-corrected VRL files, first time-correct each file using the VRL editor in VUE (under Tools menu). To speed up that process, uncheck the "Import" checkbox next to each filename, then run vrl2csv to create a CSV for each edited (e.g. time-corrected) VRL.

When using versions of VUE before 2.3, VUE can return an error code or warning message even if conversion was successful.

Author(s)

C. Holbrook (cholbrook@usgs.gov)

Examples

## Not run: 

#get path to example VRL in this package
myVRL <- system.file("extdata", "VR2W_109924_20110718_1.vrl",
 package="glatos")
vrl2csv(dirname(myVRL)) #directory input
vrl2csv(myVRL) #file name input

#setting 'overwrite=FALSE' will make new file with '_n'added to name
vrl2csv(myVRL, overwrite=F)

## End(Not run)


jsta/glatos documentation built on July 11, 2022, 7:01 a.m.