#R_函数#TS——时间序列

#TS DESCRIPTION#
Time-Series Objects

Description

The function ts is used to create time-series objects.

as.ts and is.ts coerce an object to a time-series and test whether an object is a time series.

Usage

ts(data = NA, start = 1, end = numeric(0), frequency = 1,deltat = 1, ts.eps = getOption("ts.eps"), class = , names = )
as.ts(x, ...)
is.ts(x)
Arguments

data
a numeric vector or matrix of the observed time-series values. A data frame will be coerced to a numeric matrix via data.matrix.

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. See the examples for the use of the second form.

end
the time of the last observation, specified in the same way as start.

frequency
the number of observations per unit of time.

deltat
the fraction of the sampling period between successive observations; e.g., 1/12 for monthly data. Only one of frequency or deltat should be provided.

ts.eps
time series comparison tolerance. Frequencies are considered equal if their absolute difference is less than ts.eps.

class
class to be given to the result, or none if NULL or "none". The default is "ts" for a single series, c("mts", "ts") for multiple series.

names
a character vector of names for the series in a multiple series: defaults to the colnames of data, or Series 1, Series 2, ....

x
an arbitrary R object.

...
arguments passed to methods (unused for the default method).


EXAMPLE:
> xx<-ts(1:1095,start=c(2011,1,1),frequency=365) #DATA=1:1095;起始时间是2011年1月1日;一年为一个周期
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值