[R] "timeDate" package: Read dates from xls or txt

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Tue Sep 30 03:27:33 CEST 2014


Your questions still don't make sense. Can you use a car to make lunch? You could use it to drive to the store and get ingredients for lunch, but it isn't a very useful question.

The timeDate package is a package of useful functions, not a class of data. Re-read my description below, or better yet read the documentation for that package. Zoo is both a package and a class of data defined in that package, but it allows you to choose which kind of time object you want to use as the index of your time series. POSIXct is one type that zoo can use, and the functions in the timeDate package might even be helpful to you in getting that index vector ready to give to the zoo function... or not. Depends what you need to do to your time data to make it useful.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

On September 29, 2014 6:10:01 PM PDT, jpm miao <miaojpm at gmail.com> wrote:
>Thanks. Could "timeDate" object be transformed to/from "zoo" or "xts"?
>
>2014-09-30 9:01 GMT+08:00 Jeff Newmiller <jdnewmil at dcn.davis.ca.us>:
>
>> If you read the documentation for that package you will find that the
>> answer is no, for the simple reason that it doesn't do input or
>output. It
>> does help you with conversions between POSIXt types, and can help
>figure
>> out which days are holidays or weekends, but you need the date in
>character
>> format to start.
>>
>> For reading in CSV data I use as.is=TRUE or stringsAsFactors=FALSE in
>my
>> call to read.csv. For reading xls files I have had difficulties,
>which is
>> why I prefer to export Excel data to CSV before reading it into R. 
>One
>> XLConnect bug workaround I have used is to convert the timestamp
>column
>> into character using as.character with specified format and then back
>using
>> as.POSIXct and a specified timezone, but it was borne of desperation
>and
>> may not always be necessary or even sufficient.
>>
>> Please post using plain text rather than HTML format on this list.
>Only
>> you can prevent your postings from being garbled.
>>
>---------------------------------------------------------------------------
>> Jeff Newmiller                        The     .....       .....  Go
>Live...
>> DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live
>> Go...
>>                                       Live:   OO#.. Dead: OO#.. 
>Playing
>> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
>> /Software/Embedded Controllers)               .OO#.       .OO#. 
>rocks...1k
>>
>---------------------------------------------------------------------------
>> Sent from my phone. Please excuse my brevity.
>>
>> On September 29, 2014 2:47:01 AM PDT, jpm miao <miaojpm at gmail.com>
>wrote:
>> >Hi,
>> >
>> >   timeDate package create a date vector like this:
>> >
>> >   Dates <- c("1989-09-28","2001-01-15","2004-08-30","1990-02-09")
>> >
>> >
>> >   I have a date whose size is large. Could this package read the
>dates
>> >from xls or txt files? Could we convert the read vector (e.g., I
>> >usually
>> >use XLConnect to read xls files) to the date?
>> >
>> >   Thanks,
>> >
>> >Miao
>> >
>> >       [[alternative HTML version deleted]]
>> >
>> >______________________________________________
>> >R-help at r-project.org mailing list
>> >https://stat.ethz.ch/mailman/listinfo/r-help
>> >PLEASE do read the posting guide
>> >http://www.R-project.org/posting-guide.html
>> >and provide commented, minimal, self-contained, reproducible code.
>>
>>



More information about the R-help mailing list