readDat: readDat

View source: R/dat.R

readDatR Documentation

readDat

Description

Read a data logger .dat file into a data-frame

Usage

readDat(fName, nRowsFileInfo = 1, nRowsColInfo = 2, 
    sep = ",", ..., colClasses = rep(NA, 
        ncol(colInfo)), colsTimeStamp = 1, 
    formatTS = NULL, tz = "UTC", na.strings = c("", 
        "NA", "NAN", "\"NAN\""))

Arguments

fName

scalar string: file name or a connection, e.g. returned by unz

nRowsFileInfo

integer scalar: number of lines before column information

nRowsColInfo

integer vector: number of lines with column description

sep

column separator

...

further arguments to link{read.table}

colClasses

see link{read.table}

colsTimeStamp

integer vector: colums with time stamp column (will be set to POSIXct

formatTS

format string of the timestamp columns, see strptime, e.g.

tz

specify a time zone when converting to POSIXct, default: current local e.g CET, UTC

na.strings

see link{read.table}

Details

When providing an open connection, caller is responsible for closing it. Closed connections are closed on exit of the function.

Author(s)

Thomas Wutzler, Oscar Perez Priego

See Also

read81xVar

Examples

fName <- system.file(
  "genData/chamberLoggerEx1_short.dat", package = "RespChamberProc")
if (nzchar(fName)) {
	ds <- readDat(fName)
}
# reading first from zipped file
fName <- system.file(
  "genData/SMANIE_Chamber1_26032015.zip", package = "RespChamberProc")
if (nzchar(fName)) {
	ds <- readDat( unz(fName, filename = unzip(fName, list = TRUE)[1,"Name"] )
			,tz = "UTC")
}

bgctw/RespChamberProc documentation built on Jan. 4, 2024, 6:12 a.m.