openair
. In particular it helps to get the
date or date/time into the correct format. The file can contain
either a date or date/time in a single column or a date in one
column and time in another.
import(file = file.choose(), file.type = "csv", sep = ",", header.at = 1, data.at = 2, date = "date", date.format = "%d/%m/%Y %H:%M", time = NULL, time.format = NULL, tzone = "GMT", na.strings = c("", "NA"), quote = "\"", ws = NULL, wd = NULL, correct.time = NULL, ...)
file =
file.choose()
, opens browser. Alternatively, the use of
read.table
(in utils
) also allows this to be a character
vector of a file path, connection or url.NULL
if
no header to be used.strptime
. For example, a date format
such as 1/11/2000 12:00 (day/month/year hour:minutes) is given the
format %d/%m/%Y %H:%M. See examples below and strptime
for more details.date
contains no information about time.time
then the
time format must be supplied. Common examples include %H:%M
(like 07:00) or an integer giving the hour, in which case the
format is %H. Again, see examples below.tzone = "Etc/GMT+5"
. To set the time
zone of the data to Central European Time (CET, 1 hour ahead of
GMT) set tzone = "Etc/GMT-1"
. Note that the positive
and negative offsets are opposite to what most users expect.ws = "WSPD"
.wd = "WDIR"
.NULL
turns this option off. This can be useful if
the hour is represented as 1 to 24 (rather than 0 to 23 assumed by
R). In which case correct.time = -3600
will correct the
hour.read.table
.strptime
to parse dates and
times. Users should consider the examples for use of these
formats.The function can either deal with combined date-time formats
e.g. 10/12/1999 23:00 or with two separate columns that deal with
date and time. Often there is a column for the date and another
for hour. For the latter, the option time.format = "%H"
should be supplied. Note that R considers hours 0 to 23. However,
if hours 1 to 24 are detected import
will correct the hours
accordingly.
import
will also ensure wind speed and wind direction are
correctly labelled (i.e. "ws", "wd") if ws
or wd
are
given.
Note that it is assumed that the input data are in GMT (UTC) format and in particular there is no consideration of daylight saving time i.e. where in the input data set an hour is missing in spring and duplicated in autumn.
Examples of use are given in the openair manual.
importAURN
, importAURNCsv
,
importKCL
, importADMS
, etc.