Is there perhaps a particular package you are interested in here? I'm not
aware of a "pdata.frame" function... This certainly works with the xts
class. If you just mean a regular data.frame() perhaps some of the ideas in
this old thread will work with a little tweaking:
http://www.mail-archive.com/r-help@r-project.org/msg142805.html

Michael Weylandt

On Thu, Sep 22, 2011 at 10:36 AM, Cecilia Carmo <cecilia.ca...@ua.pt> wrote:

> Hi R-helpers
>
>
>
> I want a function that performs the opposite of lag() with panel data.
>
> I have transformed my data before with pdata.frame(mydata,
> index=c("groupindex", “timeindex"))
>
> And then I’ve done lag(mydata, -1) but it doesn’t work.
>
>
>
> The error message was:
>
> Error in rep(1, ak) : invalid 'times' argument
>
>
>
> Thank you in advance,
>
>
>
> Cecília Carmo
>
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to