handling dates

12 views
Skip to first unread message

Tamas Papp

unread,
Oct 1, 2013, 10:00:48 AM10/1/13
to Lisp-stat
Hi everyone,

What do you use for working with dates (eg in time series?) For
example, in R I would do stuff like this:

--8<---------------cut here---------------start------------->8---
date.start <- as.Date("1979-01-01")
date.end <- as.Date("2012-10-01")

pick.date.range <- function(dataframe, start=date.start, end=date.end) {
dates <- dataframe[, "DATE"]
dataframe[(dates >= start) & (dates <= end), ]
}

my.dates <- seq(date.start, date.end, by="month")
--8<---------------cut here---------------end--------------->8---

Is there a CL library for this? (I checked and didn't find it, not that
it would be difficult to write, but I would not want to reinvent the
wheel, especially because dates/times have a lot of funny corner cases).

Best,

Tamas

A.J. Rossini

unread,
Oct 1, 2013, 11:11:15 AM10/1/13
to lisp...@googlegroups.com
I found one that looked quite good in theory, need to send the link tomorrow or tonight 
--
You received this message because you are subscribed to the Google Groups "Common Lisp Statistics" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lisp-stat+...@googlegroups.com.
To post to this group, send email to lisp...@googlegroups.com.
Visit this group at http://groups.google.com/group/lisp-stat.
For more options, visit https://groups.google.com/groups/opt_out.


--
best,
-tony

blind...@gmail.com
Muttenz, Switzerland.
"Commit early,commit often, and commit in a repository from which we can easily roll-back your mistakes" (AJR, 4Jan05).

Drink Coffee:  Do stupid things faster with more energy!

David Hodge

unread,
Oct 1, 2013, 8:18:51 PM10/1/13
to lisp...@googlegroups.com, lisp...@googlegroups.com
I would be interested in seeing that.

Previously, I have used antik's time points for time series, which worked, but i have not really made that into anything reusable, though the use case was pretty trivial.

Right now, I am trapped in an all consuming activity which mandates the use of spss. It's instructive from the viewpoint of observing my frustration levels as I use the product. It makes me yearn for lisp or R. So clunky, though I have a list of things for CLS,though from a feature perspective.



Sent from my iPad

A.J. Rossini

unread,
Oct 2, 2013, 1:47:47 PM10/2/13
to lisp-stat

Local-time (quicklisp-able  or http://common-lisp.net/project/local-time/ ) is what I was thinking of.    However, a quick look at cliki, http://www.cliki.net/time  , and there were a few others.

I'm not completely gone, have been going through some stressful emotional stuff related to cleaning up the house over the last few months along with dealing with more of my late wife's belongings (it's taken me 2+ years...), packing them up for my boys.  This has slowed things down, but am hoping to have large chunks of time next week while off in the mountains...

(this week and next week are school holidays, so I'm on holiday as well...).

best,
-tony



Reply all
Reply to author
Forward
0 new messages