« first day (748 days earlier)      last day (2427 days later) » 

2:03 AM
@JoshuaUlrich Moved, started new job, ..., had a hurricane... Speaking of which, has anyone heard from JD in recent months?
 
@Iterator I see posts by him on G+. I unsub'ed from his Twitter feed as he posts too bloody much. Sandy was not coming his way though.
 
2:27 AM
@DirkEddelbuettel I probably have 10K-100K twitter posts to catch up on. After I figure out how to stem the tide of emails.
I guess if he's tweeting he's not washed away.
 
 
9 hours later…
11:34 AM
hey, @Iterator is back!
 
12:00 PM
ReIterator!
2
 
 
1 hour later…
1:02 PM
Have I mentioned how much I H-A-T-E everything related to encoding?
 
@RomanLuštrik no kidding
 
EDi
@RomanLuštrik Encoding-problems are always grrrr....
 
1:21 PM
@RomanLuštrik Says he with an š in his name :)
 
1:51 PM
@Spacedman yeah I was going to say, at least half of my encoding problems have come from @RomanLuštrik including a function in taRifx!
 
Now you know the magnitude of my problems when it comes to ščž. :)
 
2:11 PM
anyone there has a good OOP example ?
 
Do you want S3, S4, Reference Classes, or R.oo?
 
@RomainFrancois Hah! I just looked through your slides from ~ 2 years ago for exactly that.
 
whatever system
some simple example where we see inheritance
this is for documenting, blogging about, new feature in Rcpp modules
@Di
@DirkEddelbuettel which ones ?
How about Shape with a method "area" and two classes "Disc" and "Rectangle"
that derive from Shape
 
2:30 PM
@RomainFrancois Your talk here. If one googles these topics it is still a top-5 hit.
 
ah yes. the one with the paper clips ?
 
Yes. The running example is the old account one. Which is less boring than 'shapes'.
 
but that lack something about inheritance, which is what I'm trying to show
 
account -> checking and account -> savings
one has a debit card, the other doesn't
I just knew that 15+ years in the financial services industry would come in handy one day. I just did not know that today would be that day. My life is now complete.
 
to be the shape thing is clearer
to me
 
2:47 PM
[ @RomainFrancois: Within a window of a few minutes you can edit your posts via the dropdown on the same line -- left edge. ]
 
basically, your words are not set in stone, but quick-drying cement!
 
 
1 hour later…
Nice work. While you're in the spirit, can you add this as a new section to the vignette?
 
In progress. But this is more or less rewriting it ...
 
 
5 hours later…
8:29 PM
Evening all. Help on this one please. Am I missing something? stackoverflow.com/questions/13200600/…
 
@MatthewDowle Howdy. I think that question is clearly confused.
 
@MatthewDowle Hi. I agree that question should be closed. I'd also like to have xts-stlye subsetting with data.table. @JoshuaUlrich, @MatthewDowle, make some magic happen please :-)
 
@GSee Glady. I accept PayPal and cashier's check.
 
Don't sound like magic
 
Oh, you want free magic! ;-)
 
8:37 PM
and yesterday!
 
and a pony!
 
I'm probably not familiar enough with panel data, but the example use case in the OP is... unhelpful
"should I use data.table or xts to lag?"
 
@GSee xts's ISO datetime range magic in i, or natural language in by like "3 weeks"? Or both? What's some example queries you'd like, and I'll see...
 
the former
x["2011"]
x["2011-01/2011-02"]
I think the latter can already be used with last and first
I think it would have to be: if a key is timeBased, then allow subsetting like above (x['2011-01-01/2011-01-15'])
 
Ok. Does this mean 'give me all the data in the table between these dates' in xts? What if you want the prevailing observation for a regular series over that range?
 
8:49 PM
Right, x['2011'] means give me all rows that are between 2011-01-01 00:00:00 and 2011-12-31 23:59:59.999. x[2011-01-01/2011-01-15'] means all rows between those 2 dates. I'm not 100% sure I follow the second question. Maybe @JoshuaUlrich can chime in?
 
Say you want the end of month price from daily data, where the key is (id,date), for a set of ids. The data.table way is to create your sequence of month ends using seq.Date or something, called monthends, then join to the data: DT[CJ(ids,monthends),roll=TRUE]. That's faster than grouping by month and taking the last one, and it deals with gaps etc. So the range string would be a nice way of building that in?
 
@MatthewDowle I'm not looking to get the last value of a month (endpoints in xts speak). I want to get ranges of dates
or, is that what the roll=TRUE does?
[I may need to learn more data.table for this conversation to be very fruitful]
 
9:08 PM
I very rarely want to get whatever data exists within a range. I tend to need a contemporaneous regular series across a set of assets. But to extract everything in the table between two points (in general) would list i join column work for you? : r-forge.r-project.org/tracker/…
 
I'm sorry, what is a data.list?
 
But I think I get the gist. Will give it some thought. Thanks you and @JoshuaUlrich for confirm on that question linked above. Where do you see data.list?
 
Instead allow DT[J(id,DT(from,to)),...]
where the i is a data.list, ...
from the link you gave
I think I get it; it just means the output of J
 
Ah. That was either typo or maybe we talked about "data.list" back then 4 years ago. But yeah, it's supposed to mean just a list column in i joining to the date vector in x's key. You might want different ranges for different ids? Or you might want different ranges/windows for the same id. With the range being a column of the join table you could do things like that.
 
9:27 PM
Ah. So, an xts object is a matrix with a sorted timeBased (i.e. Date, POSIXct, etc) index attribute. Since the "key" is always timeBased and sorted, and since the data are all of the same class (because it's a matrix), it simplifies some things. I was just thinking that if the "key" is timeBased and i is character, then it could be parsed for subsetting. But, that probably interferes with other uses for i which means the syntax may need to involve a join like you describe
@MatthewDowle, while you're here, I have a very simple data.table question. Given the following data.table, I want to divide the value NUM for "A" by the value of NUM for "B"
DT <- data.table(LET=LETTERS[1:6], NUM=c(100, 80, 20, 25, 50, 60))
setkey(DT, LET)
This is what I've come up with
DT[c("A", "B")][, NUM[1]/NUM[2]]
is there a way to do that without two "["
e.g. why doesn't this work: DT[c("A", "B"), NUM[1]/NUM[2]]
:-( Bye Matthew. Would someone else like to chime in? Should I ask this on SO main?
 
@GSee Have you tried using Python?
 
haha. you mean 'cause of the "scale" of my 6 rows of data?
If I were Alex, I'd be upset that someone else with the same name keeps commenting on the same posts.
 
9:54 PM
@GSee There are two Alex? I seem to remember an Alex and an alex, but I see that now when I hover how the name different reps come up. Hm! So could I create a new user and call my second self @JoshuaUlrich?
 
@MatthewDowle I think you should do it. It can only help my online reputation.
 
Heh heh. @GSee That's a great question. Answer: because by-without-by means that j runs for each row of i. Either set mult="first"|"last": DT[c("A","B"),NUM[1]/NUM[2],mult="first"] or set a dummy by: DT[c("A","B"),NUM[1]/NUM[2],by=NULL]
 
10:19 PM
Thank you @MatthewDowle
@MatthewDowle, I took a stab at a data.table solution to the following question. I'm sure there's a better way to do it if you'd like to add an answer
1
Q: Change values in Dataframe with function in R

MarMarkoi have a data frame, which looks like this, but huge so I can't do anything manually: Bank Country KeyItem Year Value A AU Income 2010 1000 A AU Income 2011 1130 A AU Income 2012 1160 B USA Depth 2010 ...

 
10:40 PM
@GSee I can't think of a better way than the way you did it.
 

« first day (748 days earlier)      last day (2427 days later) »