[R] Converting a pdataframe into dataframe

Apoorva Gupta apoorva.nipfp at gmail.com
Fri Jun 1 16:09:09 CEST 2012


> 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 to a. How do I do that?
-- 
Apoorva Gupta
Consultant
National Institute of Public Finance and Policy



More information about the R-help mailing list