Learn R Programming

oce (version 0.8-3)

read.met: Read a meteorological data file

Description

Read a meteorological data file

Usage

read.met(file, type=NULL, skip, tz=getOption("oceTz"),
         debug=getOption("oceDebug"), processingLog, ...)

Arguments

file
a connection or a character string giving the name of the file to load.
type
if NULL, then the first line is studied, in order to determine the file type. If type="msc", then a file as formatted by the Meteorological Service of Canada is assumed.
skip
optional number of lines of header that occur before the actual data. If this is not supplied, read.met scans the file until it finds a line starting with "Date/Time", and considers all lines above that to be h
tz
timezone assumed for time data
debug
a flag that turns on debugging. Set to 1 to get a moderate amount of debugging information, or to 2 to get more.
processingLog
if provided, the action item to be stored in the log. (Typically only provided for internal calls; the default that it provides is better for normal calls by a user.)
...
additional arguments, passed to called routines.

Value

  • An object of class "met", of which the data slot contains vectors time, temperature, pressure, u, and v.

Note

There seem to be several similar formats in use, so this function may not work in all cases.

Details

Reads a comma-separated value file in the format used by the Meterological Service of Canada (MSC). The agency does not publish a format for these files, so this function was based on a study of a few sample files, and it may fail for other files, if MSC changes the format.

See Also

The documentation for met-class explains the structure of meteorological objects, and also outlines the other functions dealing with them.

Examples

Run this code
library(oce)
met <- read.met("ile-rouge-eng-hourly-06012008-06302008.csv")
plot(met, which=3:4)

Run the code above in your browser using DataLab