[datatable-help] Error: variable lengths differ

Daniele Gentile daniele.gentile2 at mail.dcu.ie
Sun Jun 12 18:20:27 CEST 2011


Hi All
I'm trying to analyse currencies time series, and thus performing a
cointegration heck, however i'm having troubles with the data as I presume
it is due to market opening differences; The following piece of code that
i'm using return a variable lengths problem 

library(fImport);
JPY = fredSeries("DEXJPUS", source=NULL, frequency = "daily", from =
2004-01-04, to = Sys.timeDate(),      nDaysBack = NULL);
CAD = fredSeries("DEXCAUS", source=NULL, frequency = "daily", from =
2004-01-04, to = Sys.timeDate(), nDaysBack = NULL);

bhp=log(JPY[,]);
vale=log(CAD[,]);
plot(bhp,type="l", col="blue", xlab="Time", ylab="Log Prices", ylim=c(-1,8))
    lines(vale,type="l",col="red");

m1=lm(bhp~vale, drop.unused.levels = TRUE, na.action = na.exclude)

"Error in model.frame.default(formula = bhp ~ vale, na.action = na.exclude, 
: 
  variable lengths differ (found for 'vale')"

Hope somebody could help me with this issue
Regard Daniele

--
View this message in context: http://r.789695.n4.nabble.com/Error-variable-lengths-differ-tp3592163p3592163.html
Sent from the datatable-help mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20110612/9d93ea8d/attachment.htm>


More information about the datatable-help mailing list