[R-br] Preencher um serie temporal

Daniel Marcelino dmsilv em gmail.com
Quarta Novembro 21 04:11:27 BRST 2012


Caros,
Eu gostaria de expandir os dados abaixo para realizar uma análise
temporal de base diária.
O meu período inicial é '2012-07-01' até '2012-10-06'. É possível eu
fazer isso com meu data frame ou eu terei que criar um novo data frame
com a sequencia de dias e juntar as duas tabelas?
Meu data frame final deveria repetir os valores  apresentados nas
colunas até que uma nova medida surgisse já que os pontos de medida
que tenho são exporádicos.  Alguém já expandiu um data frame assim pra
me dizer como fazer?


structure(list(Date.beg = structure(c(15635, 15617, 15615, 15610,
15609, 15605, 15604, 15601, 15593, 15593, 15586, 15581, 15580,
15577, 15572, 15565, 15552, 15540, 15530, 15516), class = "Date"),
    Date.end = structure(c(15619, 15619, 15616, 15615, 15610,
    15607, 15604, 15602, 15595, 15594, 15587, 15582, 15581, 15579,
    15572, 15567, 15554, 15541, 15533, 15517), class = "Date"),
    Pollster = structure(c(1L, 2L, 1L, 2L, 1L, 2L, 4L, 1L, 2L,
    1L, 1L, 2L, 1L, 4L, 1L, 2L, 2L, 1L, 3L, 1L), .Label = c("Datafolha",
    "Ibope", "Veritá", "Vox Populi"), class = "factor"), Serra.PSDB = c(24,
    22, 23, 19, 22, 17, 17, 21, 19, 20, 21, 20, 22, 22, 27, 26,
    26, 30, 31.4, 31), Russomanno.PRB = c(23, 22, 25, 27, 30,
    34, 34, 35, 35, 32, 35, 31, 31, 31, 31, 26, 25, 26, 17.7,
    24), Haddad.PT = c(20, 22, 19, 18, 18, 18, 17, 15, 15, 17,
    16, 16, 14, 14, 8, 9, 6, 7, 9.5, 6), Chalita.PMDB = c(11,
    11, 11, 10, 9, 7, 5, 8, 6, 8, 7, 5, 7, 5, 6, 5, 5, 6, 4.3,
    6), Others = c(8, 7, 7, 4, 7, 6, 4, 5, 6, 7, 9, 5, 8, 6,
    10, 12, 15, 15, 8.6, 16), Null = c(8, 8, 8, NA, 8, 10, 10,
    NA, 13, 9, 8, 12, 10, NA, 10, 12, 14, 11, 13.1, 11), Undecided = c(6,
    8, 6, NA, 6, 8, 13, NA, 6, 7, 4, 9, 7, 13, 6, 10, 9, 6, 13.3,
    5), Round = structure(c(3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
    3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 2L), .Label = c("year before",
    "off campaign", "first", "second"), class = "factor"), Stage =
structure(c(2L,
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L,
    1L, 1L, 1L, 1L), .Label = c("0", "1", "2"), class = "factor"),
    Serra.Haddad = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("",
    "1", "0"), class = "factor"), N = c(3959, 1204, 2099, 1204,
    1799, 1204, 2000, 1802, 1001, 1221, 1078, 1001, 1069, 1200,
    1077, 805, 805, 1075, 1331, 1081), Err = c(2, 3, 2, 3, 2,
    3, 2.2, 2, 3, 3, 3, 3, 3, 2.8, 3, 3, 3, 3, 2.7, 3)), .Names =
c("Date.beg",
"Date.end", "Pollster", "Serra.PSDB", "Russomanno.PRB", "Haddad.PT",
"Chalita.PMDB", "Others", "Null", "Undecided", "Round", "Stage",
"Serra.Haddad", "N", "Err"), row.names = c("6", "7", "8", "9",
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
"21", "22", "23", "24", "25"), class = "data.frame")



--
"Small steps toward a much better world"


-- 
--------------------------------------------------
View my research on these pages:
http://www.crcee.umontreal.ca
http://danielmarcelino.com
http://ssrn.com/author=1640522
--------------------------------------------------
"Small steps toward a much better world"

\begin{signature}
Daniel Marcelino
Land Phone 1+514 343 6111 #3799
3200 Jean Brillant,  Office C5071
Montreal, QC; H3T 1N8
Canada
\end{signature}


Mais detalhes sobre a lista de discussão R-br