Skip to content

How do I intersecttwo time series?

15 messages · Michael, Brian G. Peterson, Jeff Ryan +3 more

#
On Mon, 2012-01-23 at 08:06 -0600, Michael wrote:
?merge

?ifelse

merge is amply covered in the xts documentation, and ifelse is covered
in many write-ups on vectorized operations in R.
#
I will repeat my earlier advice:

?merge
On Mon, 2012-01-23 at 17:53 -0600, Michael wrote:

  
    
#
On Mon, 2012-01-23 at 18:58 -0600, Michael wrote:
Those NA's exist because one series has a timestamp and the other
doesn't.  Normally, that's what you want.

na.omit(merge(x,y))
#
Try:

?merge.xts

You want join="inner" if I have been following this. 

Jeff

Jeffrey Ryan    |    Founder    |    jeffrey.ryan at lemnica.com

www.lemnica.com
On Jan 23, 2012, at 7:02 PM, "Brian G. Peterson" <brian at braverock.com> wrote:

            
#
Michael,

Maybe you do not realize that when someone writes a word with a
question mark in front of it, it means that you should look at the
help page for that function. ?For example, if you type "?merge" in an
R terminal (without the quotes) it will open the help page for that
function. ?Another option is to type help(merge)

Hope this makes it easier for you to find answers in the future,
Garrett
On Mon, Jan 23, 2012 at 5:53 PM, Michael <comtech.usa at gmail.com> wrote:
#
Well, it was just a guess since it seemed as if you didn't try it.
Maybe next time you could show us what you tried and why it didn't do
what you wanted.  Then, provide a sample dataset and desired outcome.
Those types of questions are much easier for us to answer, which is
why it is suggested here: http://www.r-project.org/posting-guide.html

Thanks for your understanding,
Garrett
On Tue, Jan 24, 2012 at 8:55 AM, Michael <comtech.usa at gmail.com> wrote:
#
The OP's confusion might also stem from the fact that

?merge

doesn't actually lead to

 ?merge.xts

which would have been much more helpful here.

I think it's a suboptimal consequence of method dispatch that there
are no pointers to documented methods...I'll try to work up a small
patch to `?` and put it on Rd to see if it gets any traction.

Perhaps something like
There are documented methods for:
merge.xts
merge.dendrogram
merge.zoo
You may wish to check these as well.

Or something like that. Feel free to send me thoughts off-list

Michael
On Tue, Jan 24, 2012 at 10:10 AM, G See <gsee000 at gmail.com> wrote: