FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

frollapply can produce output longer than the input when the window-length is also longer than the input · Issue #7646 · Rdatatable/data.table · GitHub

frollapply can produce output longer than the input when the window-length is also longer than the input #7646

Description

Is it expected that the new version of frollapply() and frollsum() for data.table version 1.18 behave differently when the window length is larger than the data object? Or is this a bug?

The difference noted below does not happen using data.table version 1.17.

Using frollsum() the output always has the same length as the input object:

frollsum(c(1,2,3,4,5),n=5)
[1] NA NA NA NA 15
frollsum(c(1,2,3,4,5),n=6)
[1] NA NA NA NA NA
frollsum(c(1,2,3,4,5),n=7)
[1] NA NA NA NA NA

But using frollapply() the output can be longer than the input object:

frollapply(c(1,2,3,4,5),N=5,FUN=sum)
[1] NA NA NA NA  15
frollapply(c(1,2,3,4,5),N=6,FUN=sum)
[1] NA NA NA NA NA
frollapply(c(1,2,3,4,5),N=7,FUN=sum)
[1] NA NA NA NA NA NA

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL