Learn R Programming

datetime (version 0.1.4)

toSAS.datetime: Convert Timepoint to SAS Format

Description

Convert timepoint objects to SAS format for writing XPT files

Usage

# S3 method for datetime
toSAS(x, format="", format.info=NULL)
# S3 method for date
toSAS(x, format="", format.info=NULL)
# S3 method for time
toSAS(x, format="", format.info=NULL)

Arguments

x

subclass of timepoint

format

SAS format name

format.info

Table of SAS format information

Value

numeric

Details

SASxport defines toSAS and calls it on each column when writing XPT files. The datetime method returns the integer number of seconds since the start of 1960-01-01. The date method returns the integer number of days since 1960-01-01.The time method returns the number of seconds since midnight.

See Also

Examples

Run this code
# NOT RUN {
if(require(SASxport)) toSAS(as.datetime('1960-01-01T00:00')) # 0
if(require(SASxport)) toSAS(as.date('1960-01-02')) # 1
if(require(SASxport)) toSAS(as.time('00:01')) # 60

# }

Run the code above in your browser using DataLab