[R] Converting a pdataframe into dataframe

2012-06-01 Thread Apoorva Gupta
> a <- data.frame(name=c(rep("a",5), rep("b",5)), year=c(1989:1993, 1989:1993), > var=c(1:10)) > str(a) > b <- pdata.frame(a, index=c("name","year")) > str(b) Now, I want to convert b into a data frame and have a structure similar

Re: [R] Taking a lead in panel data

2012-05-10 Thread Apoorva Gupta
NA0 3-20063 2006 NA NA NA 3-20073 2007 45 0 NA 3-20083 2008 NA NA NA On Tue, May 8, 2012 at 6:21 PM, Liviu Andronic wrote: > On Tue, May 8, 2012 at 12:14 PM, Apoorva Gupta > wrote: > > I have check

Re: [R] Taking a lead in panel data

2012-05-08 Thread Apoorva Gupta
I have checked that. It allows me to get the t-1, t-2 value but not the t+1 value. Is there any other way of achieving this other than using the plm package? On Mon, May 7, 2012 at 8:27 PM, Liviu Andronic wrote: > On Mon, May 7, 2012 at 3:21 PM, Apoorva Gupta > wrote: > > Dear R use

[R] Taking a lead in panel data

2012-05-07 Thread Apoorva Gupta
3 2008 NA NA Could you tell me if such a function exists in the plm package? Thank you -- Apoorva Gupta Consultant National Institute of Public Finance and Policy [[alternative HTML version deleted]] __ R-help@r-project.org mailin

[R] Searching for a pattern within a vector

2012-02-23 Thread Apoorva Gupta
pattern (0,0,1,1,1,1) occuring anywhere in the vector. This means I want vectors a,c,e and not b and d. Is there any grep feature which can help me do this? Thank you Apoorva -- Apoorva Gupta Consultant National Institute of Public Finance and Policy