GithubHelp home page GithubHelp logo

roll_min and roll_max about roll HOT 3 CLOSED

hadley avatar hadley commented on August 19, 2024
roll_min and roll_max

from roll.

Comments (3)

jasonjfoster avatar jasonjfoster commented on August 19, 2024 1

I have added both roll_min and roll_max in the development version. Here's an example:

# devtools::install_github("jjf234/roll")

library(roll)
library(testthat)

n_vars <- 30
n_obs <- 1500
x <- matrix(rnorm(n_obs * n_vars), nrow = n_obs, ncol = n_vars)

# rolling minimums ('min_obs = 1' equivalent to 'partial = TRUE')
expect_equivalent(roll_min(x, 5, min_obs = 1),
                  rollapplyr(x, 5, min, partial = TRUE))

# rolling maximums
expect_equivalent(roll_max(x, 5, min_obs = 1),
                  rollapplyr(x, 5, max, partial = TRUE))

from roll.

jasonjfoster avatar jasonjfoster commented on August 19, 2024

Thanks, I would also like to include in future versions (see #4).

from roll.

hadley avatar hadley commented on August 19, 2024

Awesome, thanks!

from roll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.