tis
(Time Indexed Series) from a csv file,
returning the series in a list, and optionally storing them in an environment.tisFromCsv(csvFile, dateCol = "date8", dateFormat = "%Y%m%d",
tif = NULL, defaultTif = "business",
save = F, envir = parent.frame(),
naNumber = NULL, tolerance = sqrt(.Machine$double.eps), ...)
read.csv
. Also see the the rest of this help entry for
required attributes of this file.dateCol
. If
the dateCol
cells contain Excel dates, use dateFormat ==
"excel"
. If they are strings, see strptime
for date formats.NULL
(the default), the function tries to infer the frequency from the
dates in the ymdCol
column.ymdCol
column, this tif
frequency will be used.
This should be a rare occurrence.envir
argument. Default is FALSE
.save == TRUE
, the individual series (one per
column) are saved in this enviroment. Default is the frame of the caller.NULL
, numbers within tolerance
of
this number are considered to be NA
values. NA strings can
be specified by including an na.strings
argument as one of
the ...arguments that are passenaNumber
to be regarded as equal to it.
The default is about 1.48e-08.read.csv
function.tis
time series, one per column of the csv file.
The list is returned invisibly if save
is TRUE
.dateCol
must have dates in the
format indicated by dateFormat
. The dateCol
column must be present. Missing (NA) values: Missing and NA values are the same thing.
The underlying read.csv
has "," as its default separator and
"NA" as its default na.string, so the rows
20051231,,13,,42,NA,
20060131,NA,14,,43,,NA
indicate NA
values for both the Dec 2005 and Jan 2006
observations of the first, third, fifth and sixth series.
The values in the file are read into a single large tis
series,
with a tif
(Time Index Frequency) inferred from the first six
dates in the ymd column. The first date is converted to a ti
(Time Index) of that frequency and becomes the start
of the
series. Each individual column is then windowed via naWindow
to strip off leading and trailing NA
values, and the resulting
series are put into a list with names given by lower-casing the column
names from the csv file. If save
is TRUE
, the series
are also stored in envir
using those same names.
ti
, tis
, read.csv
,
read.table