File: timeSeries-slotTime.Rd

package info (click to toggle)
r-cran-timeseries 4041.111-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,704 kB
  • sloc: makefile: 14
file content (90 lines) | stat: -rw-r--r-- 1,851 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
\name{time}


\title{Get and set time stamps of a 'timeSeries'}


\alias{time}
\alias{time<-}

\alias{time,timeSeries-method}
\alias{time.timeSeries}

\alias{time<-.timeSeries}
\alias{time<-.default}

\alias{getTime}  
\alias{setTime<-}


\description{
    
    Functions and methods extracting and modifying positions 
    of 'timeSeries' objects.
        
}


\usage{
\S4method{time}{timeSeries}(x, \dots)
\method{time}{timeSeries}(x) <- value

getTime(x)         
setTime(x) <- value
}


\arguments{

  \item{value}{
    a valid value for the time component of \code{x}.
  }
  \item{x}{
    an object of class \code{timeSeries}.
  } 
  \item{\dots}{
    optional arguments passed to other methods.
  }
}

\details{
  
  \code{time} and \code{time<-} are generic functions with methods for
  class \code{"timeSeries"}. They get and set the time component of the
  object. 

  \code{getTime} and \code{setTime} are non-generic alternatives are
  non-generic wrappers of \code{time} and \code{time<-}, respectively.

  There is another generic function \code{time<-} defined in package
  \pkg{zoo}. When that package is loaded its \code{time<-} gets the
  \code{"timeSeries"} method. Also, if \code{"time<-"} is called with an
  object from class other than \code{"timeSeries"}, the call is
  dispatched to \code{"zoo:time<-"} to apply a suitable method.
  
}

\value{
  for \code{time} and \code{getTime}, a \code{"timeDate"} object,

  for \code{time<-} and and \code{setTime}, the modified
  \code{"timeSeries"} object.
           
}

\examples{   
## Create Dummy 'timeSeries' -      
   X <- timeSeries(matrix(rnorm(24), 12), timeCalendar())
   
## Return Series Positions -
   getTime(X)
   time(X)  
  
## Add / Subtract one Day from X
   setTime(X) <- time(X) - 24*3600 # sec
   X
   time(X) <- time(X) + 24*3600 # sec
   X
}

\keyword{chron}