Git Product home page Git Product logo

Comments (1)

SebKrantz avatar SebKrantz commented on September 15, 2024

Just saw this issue after reading your comment. collapse::fdiff(x, g = group, t = time, rho = param) deals with this if the time index is integer. Otherwise, you can use collapse::timeid(time), which creates integer steps from any numeric vector based on the greatest common divisor.

library(collapse)
head(D(wlddev[-3, ], by = ~ iso3c, t = ~ year))
#>   iso3c year D1.decade D1.PCGDP D1.LIFEEX D1.GINI    D1.ODA D1.POP
#> 1   AFG 1960        NA       NA        NA      NA        NA     NA
#> 2   AFG 1961         0       NA     0.516      NA 115310005 172437
#> 4   AFG 1963        NA       NA        NA      NA        NA     NA
#> 5   AFG 1964         0       NA     0.492      NA  58200012 201576
#> 6   AFG 1965         0       NA     0.485      NA  45919983 211539
#> 7   AFG 1966         0       NA     0.482      NA -30230011 218516
head(with(wlddev[-3, ], fdiff(LIFEEX, 1, 1, iso3c, year)))
#> [1]    NA 0.516    NA 0.492 0.485 0.482

Created on 2023-02-26 by the reprex package (v2.0.1)

from prais.

Related Issues (14)

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.