Re: [R] Help with dlply, loop and column names

2012-03-19 Thread Igor Sosa Mayor
Peter: many thanks for your help. This is basically what I wanted to do and in a much more elegant way. On Mon, Mar 19, 2012 at 03:13:40AM -0700, Peter Meilstrup wrote: > I'm not sure I follow exactly what group of regression models you want to > create, but a good first step might be to use re

Re: [R] Help with dlply, loop and column names

2012-03-19 Thread Peter Meilstrup
I'm not sure I follow exactly what group of regression models you want to create, but a good first step might be to use reshape so that each party's vote share goes on a different row and the vote shares are all in the same column. Then you can use plyr grouping on tipo and party to make your model

[R] Help with dlply, loop and column names

2012-03-18 Thread Igor Sosa Mayor
Hi, I have a dataframe basically like this: > head(asturias.gen2011[,c(1,4,9:14)]) municipio total upyd psoeppiu factipo 440 Allande 2031 1.44 31.10 39.75 4.01 21.62 1000-1 443Aller 12582 1.37 33.30 37.09 15.53 10.35 1-5000