Description Usage Arguments Details Value See Also Examples
The function iNZightTS
is used to create time-series objects used
in iNZight.
1 2 3 4 5 6 7 8 9 |
data |
a |
start |
the time of the first observation. Either a single number or a vector of two integers, which specify a natural time unit and a (1-based) number of samples into the time unit |
end |
the time of the last observation, specified in the
same way as |
freq |
the number of observations per unit of time |
var |
the column number or name for the observations used
from |
time.col |
which column contains the time variable |
... |
additional information passed to |
ignore.case |
logical, ignore the case? |
The function iNZgithTS
is used to create time-series
objects. Unlike ts
objects, these are lists containing
information about the time-series as well as the data and the
time-series (ts
object) itself.
If a ts
object is used to create the iNZightTS
object,
all the domain information is extracted from that object.
The function recognises the following time variable formatS without case sensitive:
"(Y)yyyy" annually data e.g."(Y)1991"
"(Y)yyyyMmm" monthly data e.g."(Y)1991M01"
"(Y)yyyyQqq" quarterly data e.g."(Y)1991Q01"
"(Y)yyyyWww" weekly data with yearly seasonality e.g."(Y)1991W01"
"(Y)yyyyDdd" daily data with yearly seasonality e.g."(Y)1991D01"
"WwwDdd" daily data with weekly seasonality e.g. "W01D01"
"DddHhh" hourly data with daily seasonality e.g. "D01H01"
The length of digits of each time unit could be flexible and allowing space between the time unit
In case of data
being a data.frame or path to a .csv
file and start
being omitted, the starting date and the
freq
is extracted from the column that includes the time
information. This column is either named "Time"
or is the first
column. If end
is omitted, all of the data will be used for the
time-series.
a iNZightTS
object. If multiple variables are requested,
the iNZightMTS
class is added to the result. The result
object contains the original data as a time series object,
as well as information on the series start, end, and frequency.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # create from a ts object
z <- iNZightTS(UKgas)
plot(z)
# create from a data.frame
x <- iNZightTS(data.frame(Return = rnorm(100), Time = 1900:1999),
var = "Return")
# or specify a time column
x <- iNZightTS(data.frame(Return = rnorm(100), Year = 1900:1999),
var = "Return", time.col = "Year")
# create from a data.frame with modified time frame
y <- iNZightTS(data.frame(Return = rnorm(100)),
start = c(1990, 1), end = c(1993, 5), freq = 12, var = 1)
plot(y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.