[R-SIG-Finance] Can't load the quantmod library, without errors.

pierre8r-list at yahoo.fr pierre8r-list at yahoo.fr
Wed Jul 30 22:21:54 CEST 2008


> zoo depends on:
> Depends:	R (≥ 2.4.1), stats
> Imports:	stats, utils, graphics, grDevices, lattice
> 
> So you will need lattice --- which should be in the default
> install of R.


I have reinstalled lattice.

No more errors messages.

But it seen I got the old wrong results.


My R code :
----------
library(quantmod)
library(xts)

Lines <-                                                                         
"2008.07.07,00:00,1.5691,1.5705,1.5691,1.5702,58
2008.07.07,01:00,1.5701,1.5702,1.5691,1.5694,94
2008.07.07,02:00,1.5693,1.5693,1.5650,1.5652,278
2008.07.07,03:00,1.5651,1.5667,1.5633,1.5643,515
2008.07.07,04:00,1.5642,1.5643,1.5631,1.5637,255
2008.07.07,05:00,1.5638,1.5647,1.5634,1.5645,301
2008.07.07,06:00,1.5644,1.5653,1.5640,1.5640,341
2008.07.07,07:00,1.5641,1.5642,1.5625,1.5641,380
2008.07.07,08:00,1.5640,1.5646,1.5617,1.5627,590
2008.07.07,09:00,1.5628,1.5639,1.5611,1.5623,810
2008.07.07,10:00,1.5622,1.5647,1.5611,1.5643,808
2008.07.07,11:00,1.5642,1.5663,1.5642,1.5658,850
2008.07.07,12:00,1.5659,1.5667,1.5627,1.5663,802
2008.07.07,13:00,1.5665,1.5671,1.5651,1.5654,436
2008.07.07,14:00,1.5653,1.5659,1.5641,1.5649,599
2008.07.07,15:00,1.5648,1.5651,1.5621,1.5634,823
2008.07.07,16:00,1.5633,1.5663,1.5631,1.5663,694
2008.07.07,17:00,1.5662,1.5674,1.5645,1.5645,815
2008.07.07,18:00,1.5646,1.5718,1.5645,1.5717,840
2008.07.07,19:00,1.5716,1.5753,1.5715,1.5745,790
2008.07.07,20:00,1.5744,1.5748,1.5725,1.5730,510
2008.07.07,21:00,1.5729,1.5730,1.5707,1.5718,438
2008.07.07,22:00,1.5719,1.5730,1.5716,1.5726,223
2008.07.07,23:00,1.5725,1.5728,1.5720,1.5722,69"

quotes <- read.csv(textConnection(Lines), header=FALSE)
xH <- as.xts(quotes[,-(1:2)],
as.POSIXct(paste(quotes[,1],quotes[,2]),format='%Y.%m.%d %H:%M'))
colnames(xH) <- c('Open','High','Low','Close','Volume')
xH

x4H <- to.hourly(xH,k=4, indexAt='startof')
x4H


Datas 240 minutes from  http://www.metaquotes.net/ :
--------------------------------------------------
2008.07.07,00:00,1.5691,1.5705,1.5633,1.5643,945
2008.07.07,04:00,1.5642,1.5653,1.5625,1.5641,1277
2008.07.07,08:00,1.5640,1.5663,1.5611,1.5658,3058
2008.07.07,12:00,1.5659,1.5671,1.5621,1.5634,2660
2008.07.07,16:00,1.5633,1.5753,1.5631,1.5745,3139
2008.07.07,20:00,1.5744,1.5748,1.5707,1.5722,1240


Output datas from the R code :
-----------------------------
                    xH.Open xH.High xH.Low xH.Close xH.Volume
2008-07-07 00:00:00  1.5691  1.5705 1.5691   1.5694       152
2008-07-07 02:00:00  1.5693  1.5693 1.5631   1.5645      1349
2008-07-07 06:00:00  1.5644  1.5653 1.5611   1.5623      2121
2008-07-07 10:00:00  1.5622  1.5671 1.5611   1.5654      2896
2008-07-07 14:00:00  1.5653  1.5674 1.5621   1.5645      2931
2008-07-07 18:00:00  1.5646  1.5753 1.5645   1.5718      2578
2008-07-07 22:00:00  1.5719  1.5730 1.5716   1.5722       292


Here my installed packages :
----------------------------

> 
> installed.packages()
           Package      LibPath                          Version   Priority      Bundle Contains                 
ade4       "ade4"       "p:/PROGRA~1/R/R-27~1.1/library" "1.4-9"   NA            NA     NA                       
base       "base"       "p:/PROGRA~1/R/R-27~1.1/library" "2.7.1"   "base"        NA     NA                       
boot       "boot"       "p:/PROGRA~1/R/R-27~1.1/library" "1.2-33"  "recommended" NA     NA                       
class      "class"      "p:/PROGRA~1/R/R-27~1.1/library" "7.2-42"  "recommended" "VR"   "MASS class nnet spatial"
cluster    "cluster"    "p:/PROGRA~1/R/R-27~1.1/library" "1.11.11" "recommended" NA     NA                       
codetools  "codetools"  "p:/PROGRA~1/R/R-27~1.1/library" "0.2-1"   "recommended" NA     NA                       
datasets   "datasets"   "p:/PROGRA~1/R/R-27~1.1/library" "2.7.1"   "base"        NA     NA                       
Defaults   "Defaults"   "p:/PROGRA~1/R/R-27~1.1/library" "1.1-1"   NA            NA     NA                       
foreign    "foreign"    "p:/PROGRA~1/R/R-27~1.1/library" "0.8-27"  "recommended" NA     NA                       
graphics   "graphics"   "p:/PROGRA~1/R/R-27~1.1/library" "2.7.1"   "base"        NA     NA                       
grDevices  "grDevices"  "p:/PROGRA~1/R/R-27~1.1/library" "2.7.1"   "base"        NA     NA                       
grid       "grid"       "p:/PROGRA~1/R/R-27~1.1/library" "2.7.1"   "base"        NA     NA                       
iplots     "iplots"     "p:/PROGRA~1/R/R-27~1.1/library" "1.1-2"   NA            NA     NA                       
JavaGD     "JavaGD"     "p:/PROGRA~1/R/R-27~1.1/library" "0.5-1"   NA            NA     NA                       
JGR        "JGR"        "p:/PROGRA~1/R/R-27~1.1/library" "1.6-2"   NA            NA     NA                       
KernSmooth "KernSmooth" "p:/PROGRA~1/R/R-27~1.1/library" "2.22-22" "recommended" NA     NA                       
lattice    "lattice"    "p:/PROGRA~1/R/R-27~1.1/library" "0.17-12" "recommended" NA     NA                       
MASS       "MASS"       "p:/PROGRA~1/R/R-27~1.1/library" "7.2-42"  "recommended" "VR"   "MASS class nnet spatial"
methods    "methods"    "p:/PROGRA~1/R/R-27~1.1/library" "2.7.1"   "base"        NA     NA                       
mgcv       "mgcv"       "p:/PROGRA~1/R/R-27~1.1/library" "1.4-1"   "recommended" NA     NA                       
nlme       "nlme"       "p:/PROGRA~1/R/R-27~1.1/library" "3.1-89"  "recommended" NA     NA                       
nnet       "nnet"       "p:/PROGRA~1/R/R-27~1.1/library" "7.2-42"  "recommended" "VR"   "MASS class nnet spatial"
pixmap     "pixmap"     "p:/PROGRA~1/R/R-27~1.1/library" "0.4-9"   NA            NA     NA                       
quadprog   "quadprog"   "p:/PROGRA~1/R/R-27~1.1/library" "1.4-11"  NA            NA     NA                       
quantmod   "quantmod"   "p:/PROGRA~1/R/R-27~1.1/library" "0.3-6"   NA            NA     NA                       
rJava      "rJava"      "p:/PROGRA~1/R/R-27~1.1/library" "0.5-1"   NA            NA     NA                       
rpart      "rpart"      "p:/PROGRA~1/R/R-27~1.1/library" "3.1-41"  "recommended" NA     NA                       
spatial    "spatial"    "p:/PROGRA~1/R/R-27~1.1/library" "7.2-42"  "recommended" "VR"   "MASS class nnet spatial"
splines    "splines"    "p:/PROGRA~1/R/R-27~1.1/library" "2.7.1"   "base"        NA     NA                       
stats      "stats"      "p:/PROGRA~1/R/R-27~1.1/library" "2.7.1"   "base"        NA     NA                       
stats4     "stats4"     "p:/PROGRA~1/R/R-27~1.1/library" "2.7.1"   "base"        NA     NA                       
survival   "survival"   "p:/PROGRA~1/R/R-27~1.1/library" "2.34-1"  "recommended" NA     NA                       
tcltk      "tcltk"      "p:/PROGRA~1/R/R-27~1.1/library" "2.7.1"   "base"        NA     NA                       
tools      "tools"      "p:/PROGRA~1/R/R-27~1.1/library" "2.7.1"   "base"        NA     NA                       
tseries    "tseries"    "p:/PROGRA~1/R/R-27~1.1/library" "0.10-16" NA            NA     NA                       
TTR        "TTR"        "p:/PROGRA~1/R/R-27~1.1/library" "0.14-0"  NA            NA     NA                       
utils      "utils"      "p:/PROGRA~1/R/R-27~1.1/library" "2.7.1"   "base"        NA     NA                       
xts        "xts"        "p:/PROGRA~1/R/R-27~1.1/library" "0.0-16"  NA            NA     NA                       
zoo        "zoo"        "p:/PROGRA~1/R/R-27~1.1/library" "1.5-4"   NA            NA     NA                       








      ____________________________________________________________


More information about the R-SIG-Finance mailing list