Package date. R topics documented: February 19, 2015. Version 1.2-34. Title Functions for handling dates. Description Functions for handling dates.



Similar documents
Package TimeWarp. R topics documented: April 1, 2015

Package retrosheet. April 13, 2015

Package sendmailr. February 20, 2015

AT&T Global Network Client for Windows Product Support Matrix January 29, 2015

Package wordnet. January 6, 2016

Package bizdays. March 13, 2015

Package polynom. R topics documented: June 24, Version 1.3-8

COMPARISON OF FIXED & VARIABLE RATES (25 YEARS) CHARTERED BANK ADMINISTERED INTEREST RATES - PRIME BUSINESS*

COMPARISON OF FIXED & VARIABLE RATES (25 YEARS) CHARTERED BANK ADMINISTERED INTEREST RATES - PRIME BUSINESS*

Package uptimerobot. October 22, 2015

Package TSfame. February 15, 2013

Case 2:08-cv ABC-E Document 1-4 Filed 04/15/2008 Page 1 of 138. Exhibit 8

Package jrvfinance. R topics documented: October 6, 2015

Enhanced Vessel Traffic Management System Booking Slots Available and Vessels Booked per Day From 12-JAN-2016 To 30-JUN-2017

Package hive. July 3, 2015

Domain Name Abuse Detection. Liming Wang

Analysis One Code Desc. Transaction Amount. Fiscal Period

Package empiricalfdr.deseq2

Package syuzhet. February 22, 2015

South Dakota Board of Regents. Web Time Entry. Student. Training Manual & User s Guide

Package erp.easy. September 26, 2015

Detailed guidance for employers

Package hive. January 10, 2011

ITD Help Desk Traffic Report May 2002

CENTERPOINT ENERGY TEXARKANA SERVICE AREA GAS SUPPLY RATE (GSR) JULY Small Commercial Service (SCS-1) GSR

Package sjdbc. R topics documented: February 20, 2015

Package plan. R topics documented: February 20, 2015

Ashley Institute of Training Schedule of VET Tuition Fees 2015

CAFIS REPORT

Package urltools. October 11, 2015

Package HadoopStreaming

Package searchconsoler

Sage ERP MAS 90, 200, 200 SQL, and Sage ERP MAS 500. Supported Versions

Package hoarder. June 30, 2015

NASDAQ DUBAI TRADING AND SETTLEMENT CALENDAR On US Federal Reserve Holidays, no settlements will take place for USD.

Package PKI. February 20, 2013

Package pdfetch. R topics documented: July 19, 2015

Supervisor Instructions for Approving Web Time Entry

Package RCassandra. R topics documented: February 19, Version Title R/Cassandra interface

Computing & Telecommunications Services Monthly Report March 2015

Package LexisPlotR. R topics documented: April 4, Type Package

ACCESS Nursing Programs Session 1 Center Valley Campus Only 8 Weeks Academic Calendar 8 Weeks

ACCESS Nursing Programs Session 1 Center Valley Campus Only 8 Weeks Academic Calendar 8 Weeks

Package bigdata. R topics documented: February 19, 2015

Package CRM. R topics documented: February 19, 2015

Package httprequest. R topics documented: February 20, 2015

P/T 2B: 2 nd Half of Term (8 weeks) Start: 24-AUG-2015 End: 18-OCT-2015 Start: 19-OCT-2015 End: 13-DEC-2015

Managing Users and Identity Stores

Package xtal. December 29, 2015

Package PKI. July 28, 2015

2016 Examina on dates

Package R4CDISC. September 5, 2015

2015 Examination dates

Human Resources Management System Pay Entry Calendar

Package changepoint. R topics documented: November 9, Type Package Title Methods for Changepoint Detection Version 2.

Boolean Expressions, Conditions, Loops, and Enumerations. Precedence Rules (from highest to lowest priority)

Package fimport. February 19, 2015

Project Cost & Schedule Monitoring Process Using MS Excel & MS Project

Working with Financial Time Series Data in R

Define calendars. Pre specified holidays

Package neuralnet. February 20, 2015

2015 Settlement Calendar for ASX Cash Market Products ¹ Published by ASX Settlement Pty Limited A.B.N

Comparing share-price performance of a stock

University-Wide Academic Calendar

DESIGN BUILD TEST TRAIN/DEPLOY MAINTENANCE

PROJECTS SCHEDULING AND COST CONTROLS

Package tagcloud. R topics documented: July 3, 2015

Package MBA. February 19, Index 7. Canopy LIDAR data

Package pxr. February 20, 2015

An Eprints Apache Log Filter for Non-Redundant Document Downloads by Browser Agents

Package decompr. August 17, 2016

Package tikzdevice. February 20, 2015

BCOE Payroll Calendar. Monday Tuesday Wednesday Thursday Friday Jun Jul Full Force Calc

Legislative Brief: PAY OR PLAY PENALTIES LOOK BACK MEASUREMENT METHOD EXAMPLES. EmPowerHR

Special GREYSTONE COLLEGE Prices for Turkish Students

Package biganalytics

Package OECD. R topics documented: January 17, Type Package Title Search and Extract Data from the OECD Version 0.2.

Package nortest. R topics documented: July 30, Title Tests for Normality Version Date

Package cpm. July 28, 2015

Accident & Emergency Department Clinical Quality Indicators

Package bigrf. February 19, 2015

Consumer ID Theft Total Costs

FY 2015 Schedule at a Glance

University-Wide Academic Calendar

Package illuminaio. R topics documented: December 15, Version Title Parsing Illumina Microarray Output Files

P/T 2B: 2 nd Half of Term (8 weeks) Start: 26-AUG-2013 End: 20-OCT-2013 Start: 21-OCT-2013 End: 15-DEC-2013

P/T 2B: 2 nd Half of Term (8 weeks) Start: 25-AUG-2014 End: 19-OCT-2014 Start: 20-OCT-2014 End: 14-DEC-2014

Package colortools. R topics documented: February 19, Type Package

Blackboard Collaborate Web Conferencing Hosted Environment Technical Infrastructure and Security

Package png. February 20, 2015

Package CoImp. February 19, 2015

Package DCG. R topics documented: June 8, Type Package

Deep Security/Intrusion Defense Firewall - IDS/IPS Coverage Statistics and Comparison

Teller & Cash Activity Analysis Tools

Interest Rates. Countrywide Building Society. Savings Growth Data Sheet. Gross (% per annum)

Transcription:

Package date February 19, 2015 Version 1.2-34 Title Functions for handling dates Functions for handling dates. Imports graphics License GPL-2 Author Terry Therneau [aut], Thomas Lumley [trl] (R port), Kjetil Halvorsen [trl] (R port), Kurt Hornik [trl, ctb, cre] (R port) Maintainer Kurt Hornik <Kurt.Hornik@R-project.org> NeedsCompilation yes Repository CRAN Date/Publication 2014-03-17 12:26:14 R topics documented: as.date............................................ 2 date.ddmmmyy....................................... 3 date.mdy........................................... 3 date.mmddyy........................................ 4 date.mmddyyyy....................................... 5 date.object.......................................... 5 mdy.date........................................... 6 Index 8 1

2 as.date as.date Coerce Data to Dates Converts any of the following character forms to a Julian date: 8/31/56, 8-31-1956, 31 8 56, 083156, 31Aug56, or August 31 1956. as.date(x, order = "mdy",...) x order input data vector. if x is character, defines the order in which the terms are assumed to appear in a xx/xx/xx date. The default is month/day/year; any permutation of mdy is legal.... if x is character, then any other arguments from mdy.date() can be used as well. Details If x is numeric, then floor(x) is returned, e.g., as.date(35) is the same as as.date(35.2) and gives February 5, 1960 ( 5Feb60 ). If x is character, the program attempts to parse it. For each date, the number of days between it and January 1, 1960. The date will be missing if the string is not interpretable. mdy.date, date.mmddyy, date.ddmmmyy as.date(c("1jan1960", "2jan1960", "31mar1960", "30jul1960"))

date.ddmmmyy 3 date.ddmmmyy Format a Julian date Given a vector of Julian dates, this returns them in the form 10Nov89, 28Jul54, etc. date.ddmmmyy(sdate) sdate A vector of Julian dates, e.g., as returned by mdy.date(). A vector of character strings containing the formatted dates. mdy.date, date.mdy date.ddmmmyy(1:10) date.mdy Convert from Julian Dates to Month, Day, and Year Convert a vector of Julian dates to a list of vectors with the corresponding values of month, day and year, and optionally weekday. date.mdy(sdate, weekday = FALSE) sdate a Julian date value, as returned by mdy.date(), number of days since 1/1/1960. weekday if TRUE, then the returned list also will contain the day of the week (Sunday=1, Saturday=7).

4 date.mmddyy A list with components month, day, and year. References Press, W. H., Teukolsky, S. A., Vetterling, W. T., and Flannery, B. P. (1992). Numerical Recipes: The Art of Scientific Computing (Second Edition). Cambridge University Press. day <- 7 temp <- date.mdy(mdy.date(month = 7, day = day, year = 1960)) ## Check for illegal dates, such as 29 Feb in a non leap year if (temp$day!= day) { cat("some illegal dates\n") } else { cat("all days are legal\n") } date.mmddyy Format a Julian date Given a vector of Julian dates, this returns them in the form 10/11/89, 28/7/54, etc. date.mmddyy(sdate, sep = "/") sdate sep A vector of Julian dates, e.g., as returned by mdy.date(). Character string used to separate the month, day, and year portions of the returned string. A vector of character strings containing the formatted dates. date.mdy, mdy.date, date.ddmmmyy date.mmddyy(as.date(10))

date.mmddyyyy 5 date.mmddyyyy Format a Julian date Given a vector of Julian dates, this returns them in the form 10/11/1989, 28/7/1854, etc. date.mmddyyyy(sdate, sep = "/") sdate sep A vector of Julian dates, e.g., as returned by mdy.date(). Character string used to separate the month, day, and year portions of the returned string. A vector of character strings containing the formatted dates. date.mdy, mdy.date, date.ddmmmyy date.mmddyyyy(as.date(1:10)) date.object Date Objects Objects of class "date". is.date(x) x any R object.

6 mdy.date Details Dates are stored as the number of days since 1/1/1960, and are kept in integer format. (This is the same baseline value as is used by SAS). The numerical methods for dates treat date - date as a numeric, and date +- numeric as a date. is.date returns TRUE if x has class "date", and FALSE otherwise. Its behavior is unaffected by any attributes of x; for example, x could be a date array (in contrast to the behavior of is.vector). as.date returns x if x is a simple object of class "date", and otherwise a date vector of the same length as x and with data resulting from coercing the elements of x to class "date". See the manual page for as.date() for details. Logical operations as well as the numeric functions exp(), log(), and so on are invalid. Other methods exist for missing value, as.character(), printing, and summarizing. date.mdy, mdy.date, date.ddmmmyy, as.date. mdy.date Convert to Julian Dates Given a month, day, and year, returns the number of days since January 1, 1960. mdy.date(month, day, year, nineteen = TRUE, fillday = FALSE, fillmonth = FALSE) Details month day year nineteen vector of months. vector of days. vector of years. if TRUE, year values between 0 and 99 are assumed to be in the 20th century A.D.; otherwise, if FALSE, they are assumed to be in the 1st century A.D. fillday if TRUE, then missing days are replaced with 15. fillmonth if TRUE, then a missing month causes the month and day to be set to 7/1. The date functions are particularly useful in computing time spans, such as number of days on test, and similar functions can be found in other statistical packages. The baseline date of Jan 1, 1960 is, of course, completely arbitrary (it is the same one used by SAS). The fillday and fillmonth options are perhaps useful only to the author and a very few others: we sometimes deal with patients whose birth date was in the 1800 s, and only the month or even only the year is known. When the interval is greater than 80 years, a filler seems defensible.

mdy.date 7 a vector of Julian dates. References Press, W. H., Teukolsky, S. A., Vetterling, W. T., and Flannery, B. P. (1992). Numerical Recipes: The Art of Scientific Computing (Second Edition). Cambridge University Press. date.mmddyy, date.ddmmmyy, date.mmddyyyy mdy.date(3, 10, 53) xzt <-1:10 xzy <- as.date(xzt) test <- data.frame(x = xzt, date = xzy) summary(test)

Index Topic chron as.date, 2 date.ddmmmyy, 3 date.mdy, 3 date.mmddyy, 4 date.mmddyyyy, 5 date.object, 5 mdy.date, 6 [.date (date.object), 5 [[.date (date.object), 5 as.character.date (date.object), 5 as.data.frame.date (date.object), 5 as.date, 2, 6 as.vector.date (date.object), 5 date.ddmmmyy, 2, 3, 4 7 date.mdy, 3, 3, 4 6 date.mmddyy, 2, 4, 7 date.mmddyyyy, 5, 7 date.object, 5 is.date (date.object), 5 is.na.date (date.object), 5 Math.date (date.object), 5 mdy.date, 2 6, 6 Ops.date (date.object), 5 plot.date (date.object), 5 print.date (date.object), 5 Summary.date (date.object), 5 summary.date (date.object), 5 8