Learn R Programming

timetools (version 1.1-2)

timetools-package: provides objects and tools to manipulate irregular heterogeneous time data and subtime data.

Description

This package is intended to manipulate irregular time series such as subtime series, series based on time intervals, etc. This package uses only POSIXt* format.

Main things defined in this package are :

  1. the classes POSIXcti (astime intervals), POSIXctp (astime periods) and subtime (days of week, weeks of year, months of year, etc.), to deal with basic time concepts ;
  2. TimeIntervalDataFrame, TimeInstantDataFrame and SubtimeDataFrame to deal with time series (regular or not) ;
  3. methods to switch from one class to another ;
  4. and thechangeSupportmethod for TimeIntervalDataFrame (cfchangeSupportfor more details).

Arguments

Details

ll{ Package: timetools Type: Package Version: 1.1-2 Date: 2012-04-25 Depends: methods License: GPL LazyLoad: yes URL: http://sourceforge.net/projects/timetools/ Encoding: UTF-8 }

Index: RegularTimeIntervalDataFrame Create a regular TimeIntervalDataFrame from scratch SubtimeDataFrame-class Class '"SubtimeDataFrame"' TimeInstantDataFrame-class Class '"TimeInstantDataFrame"' TimeIntervalDataFrame Create a TimeIntervalDataFrame from scratch TimeIntervalDataFrame-class Class '"TimeIntervalDataFrame"' as.SubtimeDataFrame Convert an object to a SubtimeDataFrame as.TimeInstantDataFrame Convert an object to a TimeInstantDataFrame as.TimeIntervalDataFrame Convert an object to a TimeIntervalDataFrame changeSupport Function to change time support of TimeIntervalDataFrame compute.lim Calculate limits for plotting subtime Extract a specific subtime of of POSIXt object or define a subtime object timetools-package provides objects and tools to manipulate irregular heterogeneous time data and subtime data. timezone Test different properties of Time objects as.POSIXctp Convert an object to a POSIXctp ops.posixctpi Operators to sum or substract POSIXctp from POSIXct or POSIXcti origin 1970-01-01 GMT POSIXt.units define valid units for time objects posix.properties Extract time properties from POSIX* objects as.POSIXcti Convert an object to a POSIXcti

See Also

TimeInstantDataFrame, TimeIntervalDataFrame, changeSupport, SubtimeDataFrame, POSIXcti, POSIXctp

Examples

Run this code
ti1 <- TimeIntervalDataFrame (
	c('2010-01-01', '2010-02-01'), c('2010-02-01', '2010-02-02'),
	'UTC', data.frame(ex1=1:2) )

ti2 <- TimeIntervalDataFrame (
	c('2010-01-01', '2010-02-01', '2010-02-02'), NULL,
	'UTC', data.frame(ex1=1:2) )

all.equal (ti1, ti2)

ti3 <- TimeIntervalDataFrame (
	c('2010-01-01', '2010-01-02', '2010-01-04'), NULL,
	'UTC', data.frame(ex3=c(6, 1.5)))

# weighted mean over a period of 3 days with at least 75% of
# coverage (NA is retunr if not)
ti3
d <- POSIXctp(unit='day')
changeSupport (ti3, 3L*d, 0.75)


ti4 <- TimeIntervalDataFrame (
	c('2010-01-01', '2010-01-02', '2010-01-04', 
	  '2010-01-07', '2010-01-09', '2010-01-10'), NULL,
	'UTC', data.frame(ex4=c(6, 1.5, 5, 3, NA)))

# weighted mean over a period of 3 days with at least 75% of
# coverage (NA is retunr if not) or 50%
ti4
changeSupport (ti4, 3L*d, 0.75)
changeSupport (ti4, 3L*d, 0.5)

Run the code above in your browser using DataLab