Rolling Join (LOCF)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Rolling Join (LOCF)

Michael Smith
Hi everyone, 

I'm really curious about Julia and have read a lot of good things about it. Lately I've been using the data.table package in R a lot; it's one of the most popular R packages and sort of like data.frame+plyr on steroids. So I'm wondering whether there's any counterpart in Julia. 

In particular, I'm wondering how to do a rolling join in Julia. I've googled around, but have not found anything (sorry if I overlooked anything; this is my first post here). 

For illustration, here's a simple example with corresponding R code and output for reproducibility: 

1) Create the data. You can skip this part, it's just there for reproducibility.
library("data.table")
X <- 
  data.table(
    date =
      seq(
        from = as.Date("2013-01-03"),
        to = as.Date("2013-01-17"),
        by = "1 week"))
X[, value := .I]
Y <- 
  data.table(
    date =
      seq(
        from = as.Date("2013-01-08"),
        to = as.Date("2013-01-12"),
        by = "1 day"))

2) Take a look at the data. X is weekly, Y is daily.
> X
         date value
1: 2013-01-03     1
2: 2013-01-10     2
3: 2013-01-17     3
> Y
         date
1: 2013-01-08
2: 2013-01-09
3: 2013-01-10
4: 2013-01-11
5: 2013-01-12

3) Merge the data. Here the first merge is a "plain vanilla merge" without last observation carried forward (LOCF), while the second merge uses LOCF. The important thing is that the "1" value is carried forward in the second merge, although "1" does not even appear in the first merge. This is what sets this rolling join/merge apart. You can't replicate it by doing a "plain vanilla merge" and then LOCF the result. 
> setkey(X, date)
> setkey(Y, date)
> X[Y]                                # Plain vanilla merge.
         date value
1: 2013-01-08    NA
2: 2013-01-09    NA
3: 2013-01-10     2
4: 2013-01-11    NA
5: 2013-01-12    NA
> X[Y, roll = TRUE]                   # Rolling join with LOCF.
         date value
1: 2013-01-08     1
2: 2013-01-09     1
3: 2013-01-10     2
4: 2013-01-11     2
5: 2013-01-12     2

Any ideas how to do this rolling join in Julia?

Thanks, 
M

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Rolling Join (LOCF)

John Myles White
Hi Michael,

Nothing like exists so far. Our core DataFrames machinery still needs a good deal of work, so we haven’t worked on projects like this yet. If you’re interested in taking on a larger project, this would be a great contribution to the community.

 — John

On Jul 30, 2014, at 9:17 PM, Michael Smith <[hidden email]> wrote:

Hi everyone, 

I'm really curious about Julia and have read a lot of good things about it. Lately I've been using the data.table package in R a lot; it's one of the most popular R packages and sort of like data.frame+plyr on steroids. So I'm wondering whether there's any counterpart in Julia. 

In particular, I'm wondering how to do a rolling join in Julia. I've googled around, but have not found anything (sorry if I overlooked anything; this is my first post here). 

For illustration, here's a simple example with corresponding R code and output for reproducibility: 

1) Create the data. You can skip this part, it's just there for reproducibility.
library("data.table")
X <- 
  data.table(
    date =
      seq(
        from = as.Date("2013-01-03"),
        to = as.Date("2013-01-17"),
        by = "1 week"))
X[, value := .I]
Y <- 
  data.table(
    date =
      seq(
        from = as.Date("2013-01-08"),
        to = as.Date("2013-01-12"),
        by = "1 day"))

2) Take a look at the data. X is weekly, Y is daily.
> X
         date value
1: 2013-01-03     1
2: 2013-01-10     2
3: 2013-01-17     3
> Y
         date
1: 2013-01-08
2: 2013-01-09
3: 2013-01-10
4: 2013-01-11
5: 2013-01-12

3) Merge the data. Here the first merge is a "plain vanilla merge" without last observation carried forward (LOCF), while the second merge uses LOCF. The important thing is that the "1" value is carried forward in the second merge, although "1" does not even appear in the first merge. This is what sets this rolling join/merge apart. You can't replicate it by doing a "plain vanilla merge" and then LOCF the result. 
> setkey(X, date)
> setkey(Y, date)
> X[Y]                                # Plain vanilla merge.
         date value
1: 2013-01-08    NA
2: 2013-01-09    NA
3: 2013-01-10     2
4: 2013-01-11    NA
5: 2013-01-12    NA
> X[Y, roll = TRUE]                   # Rolling join with LOCF.
         date value
1: 2013-01-08     1
2: 2013-01-09     1
3: 2013-01-10     2
4: 2013-01-11     2
5: 2013-01-12     2

Any ideas how to do this rolling join in Julia?

Thanks, 
M

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Rolling Join (LOCF)

Michael Smith
Hi John,

Thanks for your reply. I definitely would be interested, but at the
moment I'm a bit time-constrained with other stuff. So maybe later.

Thanks,
M


On 07/31/2014 01:39 PM, John Myles White wrote:

> Hi Michael,
>
> Nothing like exists so far. Our core DataFrames machinery still needs a
> good deal of work, so we haven't worked on projects like this yet. If
> you're interested in taking on a larger project, this would be a great
> contribution to the community.
>
>  -- John
>
> On Jul 30, 2014, at 9:17 PM, Michael Smith <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>> Hi everyone,
>>
>> I'm really curious about Julia and have read a lot of good things
>> about it. Lately I've been using the data.table package in R a lot;
>> it's one of the most popular R packages and sort of like
>> data.frame+plyr on steroids. So I'm wondering whether there's any
>> counterpart in Julia.
>>
>> In particular, I'm wondering how to do a rolling join in Julia. I've
>> googled around, but have not found anything (sorry if I overlooked
>> anything; this is my first post here).
>>
>> For illustration, here's a simple example with corresponding R code
>> and output for reproducibility:
>>
>> 1) Create the data. You can skip this part, it's just there for
>> reproducibility.
>> |
>> library("data.table")
>> X <-
>>   data.table(
>>     date =
>>       seq(
>>         from = as.Date("2013-01-03"),
>>         to = as.Date("2013-01-17"),
>>         by = "1 week"))
>> X[, value := .I]
>> Y <-
>>   data.table(
>>     date =
>>       seq(
>>         from = as.Date("2013-01-08"),
>>         to = as.Date("2013-01-12"),
>>         by = "1 day"))
>> |
>>
>> 2) Take a look at the data. X is weekly, Y is daily.
>> |
>> > X
>>          date value
>> 1: 2013-01-03     1
>> 2: 2013-01-10     2
>> 3: 2013-01-17     3
>> > Y
>>          date
>> 1: 2013-01-08
>> 2: 2013-01-09
>> 3: 2013-01-10
>> 4: 2013-01-11
>> 5: 2013-01-12
>> |
>>
>> 3) Merge the data. Here the first merge is a "plain vanilla merge"
>> without last observation carried forward (LOCF), while the second
>> merge uses LOCF. The important thing is that the "1" value is carried
>> forward in the second merge, although "1" does not even appear in the
>> first merge. This is what sets this rolling join/merge apart. You
>> can't replicate it by doing a "plain vanilla merge" and then LOCF the
>> result.
>> |
>> > setkey(X, date)
>> > setkey(Y, date)
>> > X[Y]                                # Plain vanilla merge.
>>          date value
>> 1: 2013-01-08    NA
>> 2: 2013-01-09    NA
>> 3: 2013-01-10     2
>> 4: 2013-01-11    NA
>> 5: 2013-01-12    NA
>> > X[Y, roll = TRUE]                   # Rolling join with LOCF.
>>          date value
>> 1: 2013-01-08     1
>> 2: 2013-01-09     1
>> 3: 2013-01-10     2
>> 4: 2013-01-11     2
>> 5: 2013-01-12     2
>> |
>>
>> Any ideas how to do this rolling join in Julia?
>>
>> Thanks,
>> M
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "julia-stats" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to [hidden email]
>> <mailto:[hidden email]>.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "julia-stats" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email]
> <mailto:[hidden email]>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Rolling Join (LOCF)

Yulun Li
In reply to this post by John Myles White
Hi John, 

I work with Java, Python and R and I have been following Julia for a while. I'm very interested in contributing to the community, may I ask if you have any suggestions where I can get started developing this feature?

Thank you. 

Yulun

On Wednesday, July 30, 2014 10:39:28 PM UTC-7, John Myles White wrote:
Hi Michael,

Nothing like exists so far. Our core DataFrames machinery still needs a good deal of work, so we haven’t worked on projects like this yet. If you’re interested in taking on a larger project, this would be a great contribution to the community.

 — John

On Jul 30, 2014, at 9:17 PM, Michael Smith <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="Jn0FFDi7VPIJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">my.r...@...> wrote:

Hi everyone, 

I'm really curious about Julia and have read a lot of good things about it. Lately I've been using the data.table package in R a lot; it's one of the most popular R packages and sort of like data.frame+plyr on steroids. So I'm wondering whether there's any counterpart in Julia. 

In particular, I'm wondering how to do a rolling join in Julia. I've googled around, but have not found anything (sorry if I overlooked anything; this is my first post here). 

For illustration, here's a simple example with corresponding R code and output for reproducibility: 

1) Create the data. You can skip this part, it's just there for reproducibility.
library("data.table")
X <- 
  data.table(
    date =
      seq(
        from = as.Date("2013-01-03"),
        to = as.Date("2013-01-17"),
        by = "1 week"))
X[, value := .I]
Y <- 
  data.table(
    date =
      seq(
        from = as.Date("2013-01-08"),
        to = as.Date("2013-01-12"),
        by = "1 day"))

2) Take a look at the data. X is weekly, Y is daily.
> X
         date value
1: 2013-01-03     1
2: 2013-01-10     2
3: 2013-01-17     3
> Y
         date
1: 2013-01-08
2: 2013-01-09
3: 2013-01-10
4: 2013-01-11
5: 2013-01-12

3) Merge the data. Here the first merge is a "plain vanilla merge" without last observation carried forward (LOCF), while the second merge uses LOCF. The important thing is that the "1" value is carried forward in the second merge, although "1" does not even appear in the first merge. This is what sets this rolling join/merge apart. You can't replicate it by doing a "plain vanilla merge" and then LOCF the result. 
> setkey(X, date)
> setkey(Y, date)
> X[Y]                                # Plain vanilla merge.
         date value
1: 2013-01-08    NA
2: 2013-01-09    NA
3: 2013-01-10     2
4: 2013-01-11    NA
5: 2013-01-12    NA
> X[Y, roll = TRUE]                   # Rolling join with LOCF.
         date value
1: 2013-01-08     1
2: 2013-01-09     1
3: 2013-01-10     2
4: 2013-01-11     2
5: 2013-01-12     2

Any ideas how to do this rolling join in Julia?

Thanks, 
M

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="Jn0FFDi7VPIJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">julia-stats...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Rolling Join (LOCF)

John Myles White
If you’re interested in this feature, I’d work on cleaning up the join code that’s found in DataFrames.jl. You’ll also want to work through the code for the by() function, which implements split-apply-combine operations.

 — John

On Aug 1, 2014, at 3:15 PM, Yulun Li <[hidden email]> wrote:

Hi John, 

I work with Java, Python and R and I have been following Julia for a while. I'm very interested in contributing to the community, may I ask if you have any suggestions where I can get started developing this feature?

Thank you. 

Yulun

On Wednesday, July 30, 2014 10:39:28 PM UTC-7, John Myles White wrote:
Hi Michael,

Nothing like exists so far. Our core DataFrames machinery still needs a good deal of work, so we haven’t worked on projects like this yet. If you’re interested in taking on a larger project, this would be a great contribution to the community.

 — John

On Jul 30, 2014, at 9:17 PM, Michael Smith <my.r...@gmail.com> wrote:

Hi everyone, 

I'm really curious about Julia and have read a lot of good things about it. Lately I've been using the data.table package in R a lot; it's one of the most popular R packages and sort of like data.frame+plyr on steroids. So I'm wondering whether there's any counterpart in Julia. 

In particular, I'm wondering how to do a rolling join in Julia. I've googled around, but have not found anything (sorry if I overlooked anything; this is my first post here). 

For illustration, here's a simple example with corresponding R code and output for reproducibility: 

1) Create the data. You can skip this part, it's just there for reproducibility.
library("data.table")
X <- 
  data.table(
    date =
      seq(
        from = as.Date("2013-01-03"),
        to = as.Date("2013-01-17"),
        by = "1 week"))
X[, value := .I]
Y <- 
  data.table(
    date =
      seq(
        from = as.Date("2013-01-08"),
        to = as.Date("2013-01-12"),
        by = "1 day"))

2) Take a look at the data. X is weekly, Y is daily.
> X
         date value
1: 2013-01-03     1
2: 2013-01-10     2
3: 2013-01-17     3
> Y
         date
1: 2013-01-08
2: 2013-01-09
3: 2013-01-10
4: 2013-01-11
5: 2013-01-12

3) Merge the data. Here the first merge is a "plain vanilla merge" without last observation carried forward (LOCF), while the second merge uses LOCF. The important thing is that the "1" value is carried forward in the second merge, although "1" does not even appear in the first merge. This is what sets this rolling join/merge apart. You can't replicate it by doing a "plain vanilla merge" and then LOCF the result. 
> setkey(X, date)
> setkey(Y, date)
> X[Y]                                # Plain vanilla merge.
         date value
1: 2013-01-08    NA
2: 2013-01-09    NA
3: 2013-01-10     2
4: 2013-01-11    NA
5: 2013-01-12    NA
> X[Y, roll = TRUE]                   # Rolling join with LOCF.
         date value
1: 2013-01-08     1
2: 2013-01-09     1
3: 2013-01-10     2
4: 2013-01-11     2
5: 2013-01-12     2

Any ideas how to do this rolling join in Julia?

Thanks, 
M

-- 
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-stats...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Rolling Join (LOCF)

Michael Smith
Hi Li Yulun,

I still have some further ideas about the rolling join.

So if you're willing to give it shot, we can discuss it further and I
can at least contribute some ideas (although I don't have the time right
now to implement them myself, unfortunately).

Thanks,
M

On 08/02/2014 12:42 PM, John Myles White wrote:

> If you're interested in this feature, I'd work on cleaning up the join
> code that's found in DataFrames.jl. You'll also want to work through the
> code for the by() function, which implements split-apply-combine operations.
>
>  -- John
>
> On Aug 1, 2014, at 3:15 PM, Yulun Li <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>> Hi John,
>>
>> I work with Java, Python and R and I have been following Julia for a
>> while. I'm very interested in contributing to the community, may I ask
>> if you have any suggestions where I can get started developing this
>> feature?
>>
>> Thank you.
>>
>> Yulun
>>
>> On Wednesday, July 30, 2014 10:39:28 PM UTC-7, John Myles White wrote:
>>
>>     Hi Michael,
>>
>>     Nothing like exists so far. Our core DataFrames machinery still
>>     needs a good deal of work, so we haven't worked on projects like
>>     this yet. If you're interested in taking on a larger project, this
>>     would be a great contribution to the community.
>>
>>      -- John
>>
>>     On Jul 30, 2014, at 9:17 PM, Michael Smith <[hidden email]
>>     <http://gmail.com/>> wrote:
>>
>>>     Hi everyone,
>>>
>>>     I'm really curious about Julia and have read a lot of good things
>>>     about it. Lately I've been using the data.table package in R a
>>>     lot; it's one of the most popular R packages and sort of like
>>>     data.frame+plyr on steroids. So I'm wondering whether there's any
>>>     counterpart in Julia.
>>>
>>>     In particular, I'm wondering how to do a rolling join in Julia.
>>>     I've googled around, but have not found anything (sorry if I
>>>     overlooked anything; this is my first post here).
>>>
>>>     For illustration, here's a simple example with corresponding R
>>>     code and output for reproducibility:
>>>
>>>     1) Create the data. You can skip this part, it's just there for
>>>     reproducibility.
>>>     |
>>>     library("data.table")
>>>     X <-
>>>       data.table(
>>>         date =
>>>           seq(
>>>             from = as.Date("2013-01-03"),
>>>             to = as.Date("2013-01-17"),
>>>             by = "1 week"))
>>>     X[, value := .I]
>>>     Y <-
>>>       data.table(
>>>         date =
>>>           seq(
>>>             from = as.Date("2013-01-08"),
>>>             to = as.Date("2013-01-12"),
>>>             by = "1 day"))
>>>     |
>>>
>>>     2) Take a look at the data. X is weekly, Y is daily.
>>>     |
>>>     > X
>>>              date value
>>>     1: 2013-01-03     1
>>>     2: 2013-01-10     2
>>>     3: 2013-01-17     3
>>>     > Y
>>>              date
>>>     1: 2013-01-08
>>>     2: 2013-01-09
>>>     3: 2013-01-10
>>>     4: 2013-01-11
>>>     5: 2013-01-12
>>>     |
>>>
>>>     3) Merge the data. Here the first merge is a "plain vanilla
>>>     merge" without last observation carried forward (LOCF), while the
>>>     second merge uses LOCF. The important thing is that the "1" value
>>>     is carried forward in the second merge, although "1" does not
>>>     even appear in the first merge. This is what sets this rolling
>>>     join/merge apart. You can't replicate it by doing a "plain
>>>     vanilla merge" and then LOCF the result.
>>>     |
>>>     > setkey(X, date)
>>>     > setkey(Y, date)
>>>     > X[Y]                                # Plain vanilla merge.
>>>              date value
>>>     1: 2013-01-08    NA
>>>     2: 2013-01-09    NA
>>>     3: 2013-01-10     2
>>>     4: 2013-01-11    NA
>>>     5: 2013-01-12    NA
>>>     > X[Y, roll = TRUE]                   # Rolling join with LOCF.
>>>              date value
>>>     1: 2013-01-08     1
>>>     2: 2013-01-09     1
>>>     3: 2013-01-10     2
>>>     4: 2013-01-11     2
>>>     5: 2013-01-12     2
>>>     |
>>>
>>>     Any ideas how to do this rolling join in Julia?
>>>
>>>     Thanks,
>>>     M
>>>
>>>     --
>>>     You received this message because you are subscribed to the
>>>     Google Groups "julia-stats" group.
>>>     To unsubscribe from this group and stop receiving emails from it,
>>>     send an email to [hidden email]
>>>     <http://googlegroups.com/>.
>>>     For more options, visit https://groups.google.com/d/optout
>>>     <https://groups.google.com/d/optout>.
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "julia-stats" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to [hidden email]
>> <mailto:[hidden email]>.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "julia-stats" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email]
> <mailto:[hidden email]>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Rolling Join (LOCF)

Yulun Li
Hi John and Mike, 

I would like to work on this feature and I would love to discuss about it with both of you. 

Thanks. 

On Saturday, August 2, 2014 1:41:32 AM UTC-7, Michael Smith wrote:
Hi Li Yulun,

I still have some further ideas about the rolling join.

So if you're willing to give it shot, we can discuss it further and I
can at least contribute some ideas (although I don't have the time right
now to implement them myself, unfortunately).

Thanks,
M

On 08/02/2014 12:42 PM, John Myles White wrote:

> If you’re interested in this feature, I’d work on cleaning up the join
> code that’s found in DataFrames.jl. You’ll also want to work through the
> code for the by() function, which implements split-apply-combine operations.
>
>  — John
>
> On Aug 1, 2014, at 3:15 PM, Yulun Li <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="2AgtyXzkjjsJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">yulu...@...
> <mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="2AgtyXzkjjsJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">yulu...@...>> wrote:
>
>> Hi John,
>>
>> I work with Java, Python and R and I have been following Julia for a
>> while. I'm very interested in contributing to the community, may I ask
>> if you have any suggestions where I can get started developing this
>> feature?
>>
>> Thank you.
>>
>> Yulun
>>
>> On Wednesday, July 30, 2014 10:39:28 PM UTC-7, John Myles White wrote:
>>
>>     Hi Michael,
>>
>>     Nothing like exists so far. Our core DataFrames machinery still
>>     needs a good deal of work, so we haven’t worked on projects like
>>     this yet. If you’re interested in taking on a larger project, this
>>     would be a great contribution to the community.
>>
>>      — John
>>
>>     On Jul 30, 2014, at 9:17 PM, Michael Smith <[hidden email]
>>     <<a href="http://gmail.com/" target="_blank" onmousedown="this.href='http://gmail.com/';return true;" onclick="this.href='http://gmail.com/';return true;">http://gmail.com/>> wrote:
>>
>>>     Hi everyone,
>>>
>>>     I'm really curious about Julia and have read a lot of good things
>>>     about it. Lately I've been using the data.table package in R a
>>>     lot; it's one of the most popular R packages and sort of like
>>>     data.frame+plyr on steroids. So I'm wondering whether there's any
>>>     counterpart in Julia.
>>>
>>>     In particular, I'm wondering how to do a rolling join in Julia.
>>>     I've googled around, but have not found anything (sorry if I
>>>     overlooked anything; this is my first post here).
>>>
>>>     For illustration, here's a simple example with corresponding R
>>>     code and output for reproducibility:
>>>
>>>     1) Create the data. You can skip this part, it's just there for
>>>     reproducibility.
>>>     |
>>>     library("data.table")
>>>     X <-
>>>       data.table(
>>>         date =
>>>           seq(
>>>             from = as.Date("2013-01-03"),
>>>             to = as.Date("2013-01-17"),
>>>             by = "1 week"))
>>>     X[, value := .I]
>>>     Y <-
>>>       data.table(
>>>         date =
>>>           seq(
>>>             from = as.Date("2013-01-08"),
>>>             to = as.Date("2013-01-12"),
>>>             by = "1 day"))
>>>     |
>>>
>>>     2) Take a look at the data. X is weekly, Y is daily.
>>>     |
>>>     > X
>>>              date value
>>>     1: 2013-01-03     1
>>>     2: 2013-01-10     2
>>>     3: 2013-01-17     3
>>>     > Y
>>>              date
>>>     1: 2013-01-08
>>>     2: 2013-01-09
>>>     3: 2013-01-10
>>>     4: 2013-01-11
>>>     5: 2013-01-12
>>>     |
>>>
>>>     3) Merge the data. Here the first merge is a "plain vanilla
>>>     merge" without last observation carried forward (LOCF), while the
>>>     second merge uses LOCF. The important thing is that the "1" value
>>>     is carried forward in the second merge, although "1" does not
>>>     even appear in the first merge. This is what sets this rolling
>>>     join/merge apart. You can't replicate it by doing a "plain
>>>     vanilla merge" and then LOCF the result.
>>>     |
>>>     > setkey(X, date)
>>>     > setkey(Y, date)
>>>     > X[Y]                                # Plain vanilla merge.
>>>              date value
>>>     1: 2013-01-08    NA
>>>     2: 2013-01-09    NA
>>>     3: 2013-01-10     2
>>>     4: 2013-01-11    NA
>>>     5: 2013-01-12    NA
>>>     > X[Y, roll = TRUE]                   # Rolling join with LOCF.
>>>              date value
>>>     1: 2013-01-08     1
>>>     2: 2013-01-09     1
>>>     3: 2013-01-10     2
>>>     4: 2013-01-11     2
>>>     5: 2013-01-12     2
>>>     |
>>>
>>>     Any ideas how to do this rolling join in Julia?
>>>
>>>     Thanks,
>>>     M
>>>
>>>     --
>>>     You received this message because you are subscribed to the
>>>     Google Groups "julia-stats" group.
>>>     To unsubscribe from this group and stop receiving emails from it,
>>>     send an email to julia-stats...@googlegroups.com
>>>     <<a href="http://googlegroups.com/" target="_blank" onmousedown="this.href='http://googlegroups.com/';return true;" onclick="this.href='http://googlegroups.com/';return true;">http://googlegroups.com/>.
>>>     For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout
>>>     <<a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout>.
>>
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "julia-stats" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="2AgtyXzkjjsJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">julia-stats...@googlegroups.com
>> <mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="2AgtyXzkjjsJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">julia-stats+unsubscribe@...>.
>> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google
> Groups "julia-stats" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="2AgtyXzkjjsJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">julia-stats...@googlegroups.com
> <mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="2AgtyXzkjjsJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">julia-stats+unsubscribe@...>.
> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Rolling Join (LOCF)

Michael Smith
Not sure how this typically works. Should we discuss here on the mailing
list or somewhere else?

On 08/03/2014 02:41 PM, Yulun Li wrote:

> Hi John and Mike,
>
> I would like to work on this feature and I would love to discuss about
> it with both of you.
>
> Thanks.
>
> On Saturday, August 2, 2014 1:41:32 AM UTC-7, Michael Smith wrote:
>
>     Hi Li Yulun,
>
>     I still have some further ideas about the rolling join.
>
>     So if you're willing to give it shot, we can discuss it further and I
>     can at least contribute some ideas (although I don't have the time
>     right
>     now to implement them myself, unfortunately).
>
>     Thanks,
>     M
>
>     On 08/02/2014 12:42 PM, John Myles White wrote:
>     > If you’re interested in this feature, I’d work on cleaning up the
>     join
>     > code that’s found in DataFrames.jl. You’ll also want to work
>     through the
>     > code for the by() function, which implements split-apply-combine
>     operations.
>     >
>     >  — John
>     >
>     > On Aug 1, 2014, at 3:15 PM, Yulun Li <[hidden email] <javascript:>
>     > <mailto:[hidden email] <javascript:>>> wrote:
>     >
>     >> Hi John,
>     >>
>     >> I work with Java, Python and R and I have been following Julia for a
>     >> while. I'm very interested in contributing to the community, may
>     I ask
>     >> if you have any suggestions where I can get started developing this
>     >> feature?
>     >>
>     >> Thank you.
>     >>
>     >> Yulun
>     >>
>     >> On Wednesday, July 30, 2014 10:39:28 PM UTC-7, John Myles White
>     wrote:
>     >>
>     >>     Hi Michael,
>     >>
>     >>     Nothing like exists so far. Our core DataFrames machinery still
>     >>     needs a good deal of work, so we haven’t worked on projects like
>     >>     this yet. If you’re interested in taking on a larger project,
>     this
>     >>     would be a great contribution to the community.
>     >>
>     >>      — John
>     >>
>     >>     On Jul 30, 2014, at 9:17 PM, Michael Smith <[hidden email]
>     >>     <http://gmail.com/>> wrote:
>     >>
>     >>>     Hi everyone,
>     >>>
>     >>>     I'm really curious about Julia and have read a lot of good
>     things
>     >>>     about it. Lately I've been using the data.table package in R a
>     >>>     lot; it's one of the most popular R packages and sort of like
>     >>>     data.frame+plyr on steroids. So I'm wondering whether
>     there's any
>     >>>     counterpart in Julia.
>     >>>
>     >>>     In particular, I'm wondering how to do a rolling join in Julia.
>     >>>     I've googled around, but have not found anything (sorry if I
>     >>>     overlooked anything; this is my first post here).
>     >>>
>     >>>     For illustration, here's a simple example with corresponding R
>     >>>     code and output for reproducibility:
>     >>>
>     >>>     1) Create the data. You can skip this part, it's just there for
>     >>>     reproducibility.
>     >>>     |
>     >>>     library("data.table")
>     >>>     X <-
>     >>>       data.table(
>     >>>         date =
>     >>>           seq(
>     >>>             from = as.Date("2013-01-03"),
>     >>>             to = as.Date("2013-01-17"),
>     >>>             by = "1 week"))
>     >>>     X[, value := .I]
>     >>>     Y <-
>     >>>       data.table(
>     >>>         date =
>     >>>           seq(
>     >>>             from = as.Date("2013-01-08"),
>     >>>             to = as.Date("2013-01-12"),
>     >>>             by = "1 day"))
>     >>>     |
>     >>>
>     >>>     2) Take a look at the data. X is weekly, Y is daily.
>     >>>     |
>     >>>     > X
>     >>>              date value
>     >>>     1: 2013-01-03     1
>     >>>     2: 2013-01-10     2
>     >>>     3: 2013-01-17     3
>     >>>     > Y
>     >>>              date
>     >>>     1: 2013-01-08
>     >>>     2: 2013-01-09
>     >>>     3: 2013-01-10
>     >>>     4: 2013-01-11
>     >>>     5: 2013-01-12
>     >>>     |
>     >>>
>     >>>     3) Merge the data. Here the first merge is a "plain vanilla
>     >>>     merge" without last observation carried forward (LOCF),
>     while the
>     >>>     second merge uses LOCF. The important thing is that the "1"
>     value
>     >>>     is carried forward in the second merge, although "1" does not
>     >>>     even appear in the first merge. This is what sets this rolling
>     >>>     join/merge apart. You can't replicate it by doing a "plain
>     >>>     vanilla merge" and then LOCF the result.
>     >>>     |
>     >>>     > setkey(X, date)
>     >>>     > setkey(Y, date)
>     >>>     > X[Y]                                # Plain vanilla merge.
>     >>>              date value
>     >>>     1: 2013-01-08    NA
>     >>>     2: 2013-01-09    NA
>     >>>     3: 2013-01-10     2
>     >>>     4: 2013-01-11    NA
>     >>>     5: 2013-01-12    NA
>     >>>     > X[Y, roll = TRUE]                   # Rolling join with LOCF.
>     >>>              date value
>     >>>     1: 2013-01-08     1
>     >>>     2: 2013-01-09     1
>     >>>     3: 2013-01-10     2
>     >>>     4: 2013-01-11     2
>     >>>     5: 2013-01-12     2
>     >>>     |
>     >>>
>     >>>     Any ideas how to do this rolling join in Julia?
>     >>>
>     >>>     Thanks,
>     >>>     M
>     >>>
>     >>>     --
>     >>>     You received this message because you are subscribed to the
>     >>>     Google Groups "julia-stats" group.
>     >>>     To unsubscribe from this group and stop receiving emails
>     from it,
>     >>>     send an email to [hidden email]
>     >>>     <http://googlegroups.com/>.
>     >>>     For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>
>     >>>     <https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>>.
>     >>
>     >>
>     >> --
>     >> You received this message because you are subscribed to the Google
>     >> Groups "julia-stats" group.
>     >> To unsubscribe from this group and stop receiving emails from it,
>     send
>     >> an email to [hidden email] <javascript:>
>     >> <mailto:[hidden email] <javascript:>>.
>     >> For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>     >
>     > --
>     > You received this message because you are subscribed to the Google
>     > Groups "julia-stats" group.
>     > To unsubscribe from this group and stop receiving emails from it,
>     send
>     > an email to [hidden email] <javascript:>
>     > <mailto:[hidden email] <javascript:>>.
>     > For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "julia-stats" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [hidden email]
> <mailto:[hidden email]>.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Rolling Join (LOCF)

John Myles White
I'd suggest taking this sort of conversation offline.

Since there seems to be an implicit assumption that I should be involved in the conversation, I should probably be very direct and note that I don't personally have time to participate in a discussion about this functionality right now. It's too far removed from the work I need to be focused on. I'd like to see this happen, but I can't be involved in making it happen.

 -- John

On Aug 3, 2014, at 12:11 AM, Michael Smith <[hidden email]> wrote:

> Not sure how this typically works. Should we discuss here on the mailing
> list or somewhere else?
>
> On 08/03/2014 02:41 PM, Yulun Li wrote:
>> Hi John and Mike,
>>
>> I would like to work on this feature and I would love to discuss about
>> it with both of you.
>>
>> Thanks.
>>
>> On Saturday, August 2, 2014 1:41:32 AM UTC-7, Michael Smith wrote:
>>
>>    Hi Li Yulun,
>>
>>    I still have some further ideas about the rolling join.
>>
>>    So if you're willing to give it shot, we can discuss it further and I
>>    can at least contribute some ideas (although I don't have the time
>>    right
>>    now to implement them myself, unfortunately).
>>
>>    Thanks,
>>    M
>>
>>    On 08/02/2014 12:42 PM, John Myles White wrote:
>>> If you're interested in this feature, I'd work on cleaning up the
>>    join
>>> code that's found in DataFrames.jl. You'll also want to work
>>    through the
>>> code for the by() function, which implements split-apply-combine
>>    operations.
>>>
>>> -- John
>>>
>>> On Aug 1, 2014, at 3:15 PM, Yulun Li <[hidden email] <javascript:>
>>> <mailto:[hidden email] <javascript:>>> wrote:
>>>
>>>> Hi John,
>>>>
>>>> I work with Java, Python and R and I have been following Julia for a
>>>> while. I'm very interested in contributing to the community, may
>>    I ask
>>>> if you have any suggestions where I can get started developing this
>>>> feature?
>>>>
>>>> Thank you.
>>>>
>>>> Yulun
>>>>
>>>> On Wednesday, July 30, 2014 10:39:28 PM UTC-7, John Myles White
>>    wrote:
>>>>
>>>>    Hi Michael,
>>>>
>>>>    Nothing like exists so far. Our core DataFrames machinery still
>>>>    needs a good deal of work, so we haven't worked on projects like
>>>>    this yet. If you're interested in taking on a larger project,
>>    this
>>>>    would be a great contribution to the community.
>>>>
>>>>     -- John
>>>>
>>>>    On Jul 30, 2014, at 9:17 PM, Michael Smith <[hidden email]
>>>>    <http://gmail.com/>> wrote:
>>>>
>>>>>    Hi everyone,
>>>>>
>>>>>    I'm really curious about Julia and have read a lot of good
>>    things
>>>>>    about it. Lately I've been using the data.table package in R a
>>>>>    lot; it's one of the most popular R packages and sort of like
>>>>>    data.frame+plyr on steroids. So I'm wondering whether
>>    there's any
>>>>>    counterpart in Julia.
>>>>>
>>>>>    In particular, I'm wondering how to do a rolling join in Julia.
>>>>>    I've googled around, but have not found anything (sorry if I
>>>>>    overlooked anything; this is my first post here).
>>>>>
>>>>>    For illustration, here's a simple example with corresponding R
>>>>>    code and output for reproducibility:
>>>>>
>>>>>    1) Create the data. You can skip this part, it's just there for
>>>>>    reproducibility.
>>>>>    |
>>>>>    library("data.table")
>>>>>    X <-
>>>>>      data.table(
>>>>>        date =
>>>>>          seq(
>>>>>            from = as.Date("2013-01-03"),
>>>>>            to = as.Date("2013-01-17"),
>>>>>            by = "1 week"))
>>>>>    X[, value := .I]
>>>>>    Y <-
>>>>>      data.table(
>>>>>        date =
>>>>>          seq(
>>>>>            from = as.Date("2013-01-08"),
>>>>>            to = as.Date("2013-01-12"),
>>>>>            by = "1 day"))
>>>>>    |
>>>>>
>>>>>    2) Take a look at the data. X is weekly, Y is daily.
>>>>>    |
>>>>>> X
>>>>>             date value
>>>>>    1: 2013-01-03     1
>>>>>    2: 2013-01-10     2
>>>>>    3: 2013-01-17     3
>>>>>> Y
>>>>>             date
>>>>>    1: 2013-01-08
>>>>>    2: 2013-01-09
>>>>>    3: 2013-01-10
>>>>>    4: 2013-01-11
>>>>>    5: 2013-01-12
>>>>>    |
>>>>>
>>>>>    3) Merge the data. Here the first merge is a "plain vanilla
>>>>>    merge" without last observation carried forward (LOCF),
>>    while the
>>>>>    second merge uses LOCF. The important thing is that the "1"
>>    value
>>>>>    is carried forward in the second merge, although "1" does not
>>>>>    even appear in the first merge. This is what sets this rolling
>>>>>    join/merge apart. You can't replicate it by doing a "plain
>>>>>    vanilla merge" and then LOCF the result.
>>>>>    |
>>>>>> setkey(X, date)
>>>>>> setkey(Y, date)
>>>>>> X[Y]                                # Plain vanilla merge.
>>>>>             date value
>>>>>    1: 2013-01-08    NA
>>>>>    2: 2013-01-09    NA
>>>>>    3: 2013-01-10     2
>>>>>    4: 2013-01-11    NA
>>>>>    5: 2013-01-12    NA
>>>>>> X[Y, roll = TRUE]                   # Rolling join with LOCF.
>>>>>             date value
>>>>>    1: 2013-01-08     1
>>>>>    2: 2013-01-09     1
>>>>>    3: 2013-01-10     2
>>>>>    4: 2013-01-11     2
>>>>>    5: 2013-01-12     2
>>>>>    |
>>>>>
>>>>>    Any ideas how to do this rolling join in Julia?
>>>>>
>>>>>    Thanks,
>>>>>    M
>>>>>
>>>>>    --
>>>>>    You received this message because you are subscribed to the
>>>>>    Google Groups "julia-stats" group.
>>>>>    To unsubscribe from this group and stop receiving emails
>>    from it,
>>>>>    send an email to [hidden email]
>>>>>    <http://googlegroups.com/>.
>>>>>    For more options, visit https://groups.google.com/d/optout
>>    <https://groups.google.com/d/optout>
>>>>>    <https://groups.google.com/d/optout
>>    <https://groups.google.com/d/optout>>.
>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "julia-stats" group.
>>>> To unsubscribe from this group and stop receiving emails from it,
>>    send
>>>> an email to [hidden email] <javascript:>
>>>> <mailto:[hidden email] <javascript:>>.
>>>> For more options, visit https://groups.google.com/d/optout
>>    <https://groups.google.com/d/optout>.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "julia-stats" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>    send
>>> an email to [hidden email] <javascript:>
>>> <mailto:[hidden email] <javascript:>>.
>>> For more options, visit https://groups.google.com/d/optout
>>    <https://groups.google.com/d/optout>.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "julia-stats" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to [hidden email]
>> <mailto:[hidden email]>.
>> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Rolling Join (LOCF)

Yulun Li
Ok, I would love to give it a try. I will exchange emails in a smaller group and post my progress to the group. 

On Tuesday, August 5, 2014 10:25:17 PM UTC-7, John Myles White wrote:
I’d suggest taking this sort of conversation offline.

Since there seems to be an implicit assumption that I should be involved in the conversation, I should probably be very direct and note that I don’t personally have time to participate in a discussion about this functionality right now. It’s too far removed from the work I need to be focused on. I’d like to see this happen, but I can’t be involved in making it happen.

 — John

On Aug 3, 2014, at 12:11 AM, Michael Smith <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="o-ogRrkLsfkJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">my.r...@...> wrote:

> Not sure how this typically works. Should we discuss here on the mailing
> list or somewhere else?
>
> On 08/03/2014 02:41 PM, Yulun Li wrote:
>> Hi John and Mike,
>>
>> I would like to work on this feature and I would love to discuss about
>> it with both of you.
>>
>> Thanks.
>>
>> On Saturday, August 2, 2014 1:41:32 AM UTC-7, Michael Smith wrote:
>>
>>    Hi Li Yulun,
>>
>>    I still have some further ideas about the rolling join.
>>
>>    So if you're willing to give it shot, we can discuss it further and I
>>    can at least contribute some ideas (although I don't have the time
>>    right
>>    now to implement them myself, unfortunately).
>>
>>    Thanks,
>>    M
>>
>>    On 08/02/2014 12:42 PM, John Myles White wrote:
>>> If you’re interested in this feature, I’d work on cleaning up the
>>    join
>>> code that’s found in DataFrames.jl. You’ll also want to work
>>    through the
>>> code for the by() function, which implements split-apply-combine
>>    operations.
>>>
>>> — John
>>>
>>> On Aug 1, 2014, at 3:15 PM, Yulun Li <[hidden email] <javascript:>
>>> <mailto:[hidden email] <javascript:>>> wrote:
>>>
>>>> Hi John,
>>>>
>>>> I work with Java, Python and R and I have been following Julia for a
>>>> while. I'm very interested in contributing to the community, may
>>    I ask
>>>> if you have any suggestions where I can get started developing this
>>>> feature?
>>>>
>>>> Thank you.
>>>>
>>>> Yulun
>>>>
>>>> On Wednesday, July 30, 2014 10:39:28 PM UTC-7, John Myles White
>>    wrote:
>>>>
>>>>    Hi Michael,
>>>>
>>>>    Nothing like exists so far. Our core DataFrames machinery still
>>>>    needs a good deal of work, so we haven’t worked on projects like
>>>>    this yet. If you’re interested in taking on a larger project,
>>    this
>>>>    would be a great contribution to the community.
>>>>
>>>>     — John
>>>>
>>>>    On Jul 30, 2014, at 9:17 PM, Michael Smith <[hidden email]
>>>>    <<a href="http://gmail.com/" target="_blank" onmousedown="this.href='http://gmail.com/';return true;" onclick="this.href='http://gmail.com/';return true;">http://gmail.com/>> wrote:
>>>>
>>>>>    Hi everyone,
>>>>>
>>>>>    I'm really curious about Julia and have read a lot of good
>>    things
>>>>>    about it. Lately I've been using the data.table package in R a
>>>>>    lot; it's one of the most popular R packages and sort of like
>>>>>    data.frame+plyr on steroids. So I'm wondering whether
>>    there's any
>>>>>    counterpart in Julia.
>>>>>
>>>>>    In particular, I'm wondering how to do a rolling join in Julia.
>>>>>    I've googled around, but have not found anything (sorry if I
>>>>>    overlooked anything; this is my first post here).
>>>>>
>>>>>    For illustration, here's a simple example with corresponding R
>>>>>    code and output for reproducibility:
>>>>>
>>>>>    1) Create the data. You can skip this part, it's just there for
>>>>>    reproducibility.
>>>>>    |
>>>>>    library("data.table")
>>>>>    X <-
>>>>>      data.table(
>>>>>        date =
>>>>>          seq(
>>>>>            from = as.Date("2013-01-03"),
>>>>>            to = as.Date("2013-01-17"),
>>>>>            by = "1 week"))
>>>>>    X[, value := .I]
>>>>>    Y <-
>>>>>      data.table(
>>>>>        date =
>>>>>          seq(
>>>>>            from = as.Date("2013-01-08"),
>>>>>            to = as.Date("2013-01-12"),
>>>>>            by = "1 day"))
>>>>>    |
>>>>>
>>>>>    2) Take a look at the data. X is weekly, Y is daily.
>>>>>    |
>>>>>> X
>>>>>             date value
>>>>>    1: 2013-01-03     1
>>>>>    2: 2013-01-10     2
>>>>>    3: 2013-01-17     3
>>>>>> Y
>>>>>             date
>>>>>    1: 2013-01-08
>>>>>    2: 2013-01-09
>>>>>    3: 2013-01-10
>>>>>    4: 2013-01-11
>>>>>    5: 2013-01-12
>>>>>    |
>>>>>
>>>>>    3) Merge the data. Here the first merge is a "plain vanilla
>>>>>    merge" without last observation carried forward (LOCF),
>>    while the
>>>>>    second merge uses LOCF. The important thing is that the "1"
>>    value
>>>>>    is carried forward in the second merge, although "1" does not
>>>>>    even appear in the first merge. This is what sets this rolling
>>>>>    join/merge apart. You can't replicate it by doing a "plain
>>>>>    vanilla merge" and then LOCF the result.
>>>>>    |
>>>>>> setkey(X, date)
>>>>>> setkey(Y, date)
>>>>>> X[Y]                                # Plain vanilla merge.
>>>>>             date value
>>>>>    1: 2013-01-08    NA
>>>>>    2: 2013-01-09    NA
>>>>>    3: 2013-01-10     2
>>>>>    4: 2013-01-11    NA
>>>>>    5: 2013-01-12    NA
>>>>>> X[Y, roll = TRUE]                   # Rolling join with LOCF.
>>>>>             date value
>>>>>    1: 2013-01-08     1
>>>>>    2: 2013-01-09     1
>>>>>    3: 2013-01-10     2
>>>>>    4: 2013-01-11     2
>>>>>    5: 2013-01-12     2
>>>>>    |
>>>>>
>>>>>    Any ideas how to do this rolling join in Julia?
>>>>>
>>>>>    Thanks,
>>>>>    M
>>>>>
>>>>>    --
>>>>>    You received this message because you are subscribed to the
>>>>>    Google Groups "julia-stats" group.
>>>>>    To unsubscribe from this group and stop receiving emails
>>    from it,
>>>>>    send an email to julia-stats...@googlegroups.com
>>>>>    <<a href="http://googlegroups.com/" target="_blank" onmousedown="this.href='http://googlegroups.com/';return true;" onclick="this.href='http://googlegroups.com/';return true;">http://googlegroups.com/>.
>>>>>    For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout
>>    <<a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout>
>>>>>    <<a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout
>>    <<a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout>>.
>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "julia-stats" group.
>>>> To unsubscribe from this group and stop receiving emails from it,
>>    send
>>>> an email to julia-stats...@googlegroups.com <javascript:>
>>>> <mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="o-ogRrkLsfkJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">julia-stats+unsubscribe@... <javascript:>>.
>>>> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout
>>    <<a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout>.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "julia-stats" group.
>>> To unsubscribe from this group and stop receiving emails from it,
>>    send
>>> an email to julia-stats...@googlegroups.com <javascript:>
>>> <mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="o-ogRrkLsfkJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">julia-stats+unsubscribe@... <javascript:>>.
>>> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout
>>    <<a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout>.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "julia-stats" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="o-ogRrkLsfkJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">julia-stats...@googlegroups.com
>> <mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="o-ogRrkLsfkJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">julia-stats+unsubscribe@...>.
>> For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.