tind-coercion: Conversion of Objects of 'tind' Class

tind-coercionR Documentation

Conversion of Objects of tind Class

Description

Objects of tind class can be easily converted to built-in R classes inluding numeric, integer, character, Date, POSIXct, POSIXlt, and data.frame.

Usage

## S3 method for class 'tind'
as.integer(x, ...)

## S3 method for class 'tind'
as.double(x, ...)

## S3 method for class 'tind'
as.character(x, ...)

## S3 method for class 'tind'
as.Date(x, ...)

## S3 method for class 'tind'
as.POSIXct(x, tz = NULL, ...)

## S3 method for class 'tind'
as.POSIXlt(x, tz = NULL, ...)

## S3 method for class 'tind'
as.data.frame(x, ...)

Arguments

x

an object of tind class.

...

further arguments passed to or from other methods.

tz

(optional) a character value determining the time zone (the default NULL is interpreted as the system time zone). See tzone documentation for information on time zones.

Details

as.double and as.numeric return internal representation for particular time index type (seconds, days, weeks etc. since ...).

For years, quarters, months, weeks, and dates, as.integer returns representation in the form YYYY, YYYYQ, YYYYMM, YYYYWW, and YYYYMMDD, respectively. For other index types, as.integer returns internal representation of time indices converted to integer.

as.character returns character vector with standard (ISO 8601) representation of time indices. For customisable output formats, see format.

as.Date, as.POSIXct, and as.POSIXlt return objects of classes Date, POSIXct, and POSIXlt, respectively.

as.data.frame returns a 1-column data frame with time indices and allows to work with time indices in data frames.

Value

as.xxx returns an object of xxx class of the same length as the argument. as.data.frame returns a data frame with a single column and the number of rows equal to the length of the argument.

See Also

format for customisable character output formats, as.tind for conversion to tind. For conversions between tind class and other classes (from packages other than base), see tind-other.


tind documentation built on Dec. 28, 2025, 1:06 a.m.