[R-SIG-Finance] How to remove the error : Error in dimnames(x) <- dn : length of 'dimnames' [2] not equal to array extent
pierre8r-list at yahoo.fr
pierre8r-list at yahoo.fr
Mon Jun 23 23:38:06 CEST 2008
Hello,
The errors from the console :
> colnames(x) <- c('Open','High','Low','Close','Volume')
Error in dimnames(x) <- dn :
length of 'dimnames' [2] not equal to array extent
The complete script :
library(xts)
library(quantmod)
quotes <- read.csv2("K:\\00001-Compare\\Output\\OutputJBacktesting\\Quotes1HOUR.txt", header = FALSE, sep = ",", dec=".")
x <- xts(as.matrix(quotes[,-(1:2)]),as.POSIXct(paste(quotes[,1],quotes[,2]),format='%m/%d/%Y
%H:%M'))
colnames(x) <- c('Open','High','Low','Close','Volume')
barChart(x,TA=NULL)
Thanks,
Pierre8r
Some datas :
01/08/2007 00:59:00,1.930250,1.930350,1.929300,1.929600,-60
01/08/2007 01:59:00,1.929600,1.930100,1.926250,1.928050,-60
01/08/2007 02:59:00,1.928050,1.929700,1.927700,1.927800,-60
01/08/2007 03:59:00,1.927800,1.928350,1.927200,1.928250,-60
01/08/2007 04:59:00,1.928250,1.929600,1.928250,1.929000,-60
01/08/2007 05:59:00,1.929000,1.929250,1.928650,1.929250,-60
01/08/2007 06:59:00,1.929250,1.930850,1.928700,1.930650,-60
01/08/2007 07:59:00,1.930650,1.933100,1.930250,1.933000,-60
01/08/2007 08:59:00,1.933000,1.934350,1.931050,1.931100,-60
01/08/2007 09:59:00,1.931100,1.934750,1.930350,1.934000,-60
01/08/2007 10:59:00,1.934000,1.934650,1.932300,1.932400,-60
01/08/2007 11:59:00,1.932400,1.933500,1.931200,1.933050,-60
01/08/2007 12:59:00,1.933050,1.933850,1.932100,1.933600,-60
01/08/2007 13:59:00,1.933600,1.933750,1.932400,1.933450,-60
01/08/2007 14:59:00,1.933450,1.933600,1.928650,1.929050,-60
01/08/2007 15:59:00,1.929050,1.934600,1.928250,1.934100,-60
01/08/2007 16:59:00,1.934100,1.937350,1.934000,1.934650,-60
01/08/2007 17:59:00,1.934650,1.938650,1.934050,1.938400,-60
01/08/2007 18:59:00,1.938400,1.940500,1.937150,1.937750,-60
01/08/2007 19:59:00,1.937750,1.939350,1.937300,1.937300,-60
01/08/2007 20:59:00,1.937300,1.938700,1.936150,1.937800,-60
01/08/2007 21:59:00,1.937800,1.938400,1.937700,1.937800,-60
01/08/2007 22:59:00,1.937800,1.938150,1.937400,1.937800,-60
01/08/2007 23:58:00,1.938150,1.939250,1.938150,1.939050,-44
____________________________________________________________
ente http://mail.yahoo.fr
More information about the R-SIG-Finance
mailing list