[R-es] diff()
Otto F. Wagner
ofwagner en gmail.com
Dom Ene 15 18:30:36 CET 2012
*Hola a todos, estoy intentado hacer una primera diferencia en una serie
temporal.*
*
*
*Me da error. Os paso el código con los errores y el dato.*
*
*
*Uso R 14 con Rstudio en windows7-64 bits.*
*
*
> ejemplo_agregado$total_dif<- diff(ejemplo_agregado$Total)Error en `$<-.data.frame`(`*tmp*`, "total_dif", value = c(-0.03881, -0.0314286960000001, :
replacement has 155 rows, data has 156> >
ejemplo_agregado$total_dif<- diff(ejemplo_agregado$Total, lag=1,
differences=1)Error en `$<-.data.frame`(`*tmp*`, "total_dif", value =
c(-0.03881, -0.0314286960000001, :
replacement has 155 rows, data has 156Error in if (eval(parse(text =
paste("nrow(", dsnameValue, ")"))) == 0) { :
argumento tiene longitud cero
Muchas gracias y saludos,
Otto
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20120115/6978ba8b/attachment.html>
------------ próxima parte ------------
fecha2 Total
01/01/1999 1.15913
01/02/1999 1.12032
01/03/1999 1.088891304
01/04/1999 1.070045455
01/05/1999 1.062528571
01/06/1999 1.038059091
01/07/1999 1.037236364
01/08/1999 1.060445455
01/09/1999 1.049936364
01/10/1999 1.069990476
01/11/1999 1.032572727
01/12/1999 1.010995652
01/01/2000 1.01312381
01/02/2000 0.984219048
01/03/2000 0.964595652
01/04/2000 0.94504
01/05/2000 0.907904348
01/06/2000 0.949968182
01/07/2000 0.939433333
01/08/2000 0.904195652
01/09/2000 0.870919048
01/10/2000 0.853395455
01/11/2000 0.854759091
01/12/2000 0.900009524
01/01/2001 0.938395652
01/02/2001 0.92093
01/03/2001 0.908059091
01/04/2001 0.892709524
01/05/2001 0.874856522
01/06/2001 0.852980952
01/07/2001 0.861027273
01/08/2001 0.901747826
01/09/2001 0.911735
01/10/2001 0.905952174
01/11/2001 0.888154545
01/12/2001 0.890742857
01/01/2002 0.883343478
01/02/2002 0.870835
01/03/2002 0.876433333
01/04/2002 0.886263636
01/05/2002 0.917582609
01/06/2002 0.95638
01/07/2002 0.99253913
01/08/2002 0.978040909
01/09/2002 0.980380952
01/10/2002 0.981334783
01/11/2002 1.001328571
01/12/2002 1.020313636
01/01/2003 1.062634783
01/02/2003 1.07814
01/03/2003 1.07987619
01/04/2003 1.086359091
01/05/2003 1.157622727
01/06/2003 1.167685714
01/07/2003 1.137517391
01/08/2003 1.115385714
01/09/2003 1.126109091
01/10/2003 1.170273913
01/11/2003 1.170975
01/12/2003 1.230947826
01/01/2004 1.262172727
01/02/2004 1.26434
01/03/2004 1.226856522
01/04/2004 1.199181818
01/05/2004 1.201304762
01/06/2004 1.214527273
01/07/2004 1.226918182
01/08/2004 1.219213636
01/09/2004 1.222195455
01/10/2004 1.249795238
01/11/2004 1.299895455
01/12/2004 1.34103913
01/01/2005 1.31162381
01/02/2005 1.30199
01/03/2005 1.318447826
01/04/2005 1.293971429
01/05/2005 1.268663636
01/06/2005 1.215513636
01/07/2005 1.203957143
01/08/2005 1.229556522
01/09/2005 1.224581818
01/10/2005 1.202280952
01/11/2005 1.178495455
01/12/2005 1.185945455
01/01/2006 1.2118
01/02/2006 1.19395
01/03/2006 1.202921739
01/04/2006 1.22783
01/05/2006 1.276756522
01/06/2006 1.266422727
01/07/2006 1.268733333
01/08/2006 1.280895652
01/09/2006 1.273119048
01/10/2006 1.262054545
01/11/2006 1.288990909
01/12/2006 1.319752381
01/01/2007 1.300008696
01/02/2007 1.30843
01/03/2007 1.324363636
01/04/2007 1.351080952
01/05/2007 1.35136087
01/06/2007 1.342290476
01/07/2007 1.372227273
01/08/2007 1.362486957
01/09/2007 1.39121
01/10/2007 1.422682609
01/11/2007 1.468131818
01/12/2007 1.45542381
01/01/2008 1.471421739
01/02/2008 1.475557143
01/03/2008 1.553004762
01/04/2008 1.575159091
01/05/2008 1.556122727
01/06/2008 1.55622381
01/07/2008 1.575834783
01/08/2008 1.495052381
01/09/2008 1.435527273
01/10/2008 1.328226087
01/11/2008 1.273215
01/12/2008 1.353382609
01/01/2009 1.327590909
01/02/2009 1.28053
01/03/2009 1.304886364
01/04/2009 1.32045
01/05/2009 1.366585714
01/06/2009 1.401677273
01/07/2009 1.408708696
01/08/2009 1.426861905
01/09/2009 1.456872727
01/10/2009 1.481309091
01/11/2009 1.491419048
01/12/2009 1.457178261
01/01/2010 1.427961905
01/02/2010 1.36816
01/03/2010 1.35736087
01/04/2010 1.342027273
01/05/2010 1.255119048
01/06/2010 1.22185
01/07/2010 1.279159091
01/08/2010 1.289936364
01/09/2010 1.308918182
01/10/2010 1.389590476
01/11/2010 1.364072727
01/12/2010 1.322030435
01/01/2011 1.336604762
01/02/2011 1.365755
01/03/2011 1.401786957
01/04/2011 1.446128571
01/05/2011 1.432931818
01/06/2011 1.440022727
01/07/2011 1.428842857
01/08/2011 1.433195652
01/09/2011 1.375913636
01/10/2011 1.37222381
01/11/2011 1.356086364
01/12/2011 1.340185714
Más información sobre la lista de distribución R-help-es