chronological objects for data analysis

chronological objects for data analysis

ID:34649312

大小:206.20 KB

页数:14页

时间:2019-03-08

chronological objects for data analysis_第1页
chronological objects for data analysis_第2页
chronological objects for data analysis_第3页
chronological objects for data analysis_第4页
chronological objects for data analysis_第5页
资源描述:

《chronological objects for data analysis》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、daysReturnVariousPeriodsfromaChronorDatesObjectdaysdays(x)weekdays(x,abb=T)months(x,abb=T)quarters(x,abb=T)years(x)ARGUMENTSx:adatesobject.abb:shouldabbreviatednamesbereturned?DefaultisTRUE.VALUEanorderedfactorcorrespondingtodays,weekdays,months,quarters,oryearsofxfortherespectivefunction.SEEALSOi

2、s.weekend,is.holidayEXAMPLE#produceboxplotsbydayoftheweekandmonthsplot(weekdays(dts),x)plot(months(dts),y)seq.datesGenerateChronorDatesSequencesseq.datesseq.dates(from,to,by="days",length.)ARGUMENTSfrom:startingdate;itcanbeachronordatesobjet,acharacterstring,e.g.,"05/23/91",oraJuliandate.to:ending

3、date,likefrom.by:eitheranumericvalueoroneofthevalidstrings"days","weeks","months",or"years".length.:optionalnumberofelementsinthesequence.VALUEasequencewithvalues(from,from+by,from+2*by,...,to)ofclassclass(from)andoriginorigin(from).Notethatfrommustbelessthanorequaltotheargumentto.SEEALSOcut.dates

4、EXAMPLE>seq.dates("01/01/92","12/31/92",by="months")[1]01/01/9202/01/9203/01/9204/01/9205/01/9206/01/92[7]07/01/9208/01/9209/01/9210/01/9211/01/9212/01/92>end.of.the.month<-seq.dates("02/29/92",by="month",length=15)>end.of.the.month[1]02/29/9203/31/9204/30/9205/31/9206/30/9207/31/92[7]08/31/9209/3

5、0/9210/31/9211/30/9212/31/9201/31/93[13]02/28/9303/31/9304/30/9314julianConvertbetweenJulianandCalendarDatesjulianjulian(m,d,y,origin=c(month=1,day=1,year=1970))month.day.year(jul,origin=c(month=1,day=1,year=1970))leap.year(y)day.of.week(month,day,year)ARGUMENTSm:vectorofmonthnumbers.d:vectorofday

6、numbers.y:vectorofyears.jul:vectorofJulianDates,i.e.,numberofdayssinceorigin.origin:vectorspecifyingtheoriginasmonth,day,andyear.Thedefaultisc(month=1,day=1,year=1970).VALUEAvectorofJuliandates(numberofdayssinceorigin)whenjulian()iscalled,oralistwithmembersmonth,day,yearcorrespondingtotheinputJuli

7、andatesifmonth.day.year()iscalled.leap.year()returnsalogicalvectorindicatingwhetherthecorrespondingyearisaleapyear.day.of.week()returnsanumberbetween0and6tospecifydayoftheweek{0referstoSunday.Thesefunctionswereta

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。