Learn R Programming

timetools (version 1.1-2)

timezone: Test or extract different properties of Time objects

Description

These functions can be applied to Time objects such as TimeIntervalDataFrame, TimeInstantDataFrame or subtime.

Usage

timezone(object)

continuous(x, ...)

continuous(x) <- value

homogeneous(x, ...)

overlapping(x, ...)

period(x, ...)

when(x, ...)

regular(x, ...)

timezone(object) <- value

interval(x, ...)

## S3 method for class 'subtime': timezone(object)

Arguments

object
object to test, from which get or set a property
x
object to test, from which get or set a property
value
boolean if possible, set this value to the property
...
arguments to or from other methods

Value

  • depends on the method

reminder

For each class, you can type the following code to know what methods are available.

methods(class='myclass') #S3 methods showMethods(class='myclass') #S4 'methods For each S3 method, you can type the following code to know for which classes it is defined.

methods('mymethod')

For each S4 method, you can type the following code to know for which classes it is defined.

showMethods('mymethod')

continuous

For objects based on time intervals. After ordering intervals, test if the end of an interval is the start of the next interval. If any interval overlap another one, it returns FALSE.

If not any interval overlap another, and the object is not continuous, the object can be set 'continuous' with

continuous(obj) <- TRUE

Interval will be added such as the object can pass the test describe below. The data is filled with NA values.

homogeneous

For objects based on time intervals (POSIXcti). Test if intervals of the object are homogeneous : if the period of each interval is the same.

overlapping

For objects based on time intervals. Test if any interval overlap another one. Because the test can be ressource consuming, it stops at the first case encoutered that does not satisfy this condition. The two indices corresponding are printed.

period

For objects based on time intervals. Return POSIXctp of the object if it is homogeneous and continuous.

when

For Time objects. If TimeInstantDataFrame, return the instants of the object ; if TimeIntervalDataFrame, return the intervals of the object.

regular

Test if the object is regular. A TimeInstantDataFrame is regular if all instants are equally spaced. A TimeIntervalDataFrame is regular if it is homogeneous and all interval's start are equally spaced.

timezone

get or set the timezone of the time object (see timezone in the base package).

interval

For objects based on time intervals. Return POSIXcti of each interval.