0

I am trying to convert .csvfiles to the xts format using the following code:

library(highfrequency)
library(timeDate)
from="05/03/2018";
to="09/03/2018";
datasource= "C:/Users/Sha/Desktop/SUSU"
datadestination= "C:/Users/Sha/Desktop/SUSU"
convert(from,to,datasource,datadestination,trades=TRUE, quotes=FALSE, ticker= c("EURAUD","EURCAD"), dir=TRUE, extension="csv",header=TRUE,tradecolnames=c("Date","Time","Ask"), format="%d%m%Y %H:%M:%S", onefile=TRUE)

I don't understand why I am obtaining the following error:

Error in convert(from, to, datasource, : 
could not find function "convert"

If someone could help me with this? Am I making mistake to understand how to use the package?

Shahal
  • 31
  • 5
  • 1) In the code you have `convert` with lower case `c` and the error message says `Convert`, which is it? 2) None of `convert` or `Convert` are functions of package `highfrequency`. The error makes sense, where have you found that function/code? – Rui Barradas May 08 '21 at 18:34
  • `convert` it is. I have obtained the code to convert csv files to xts objects using this link: [http://highfrequency.herokuapp.com/ ]. Otherwise, I will not be able to use the covariance estimators such as rCov. – Shahal May 08 '21 at 18:38
  • The code line to install the package found in that link, `install_github("highfrequency","jonathancornelissen")`, gives an error, the git specification is wrong. And function `convert` is not a package function. The code in the link doesn't run, at least not as posted. As for conversion to csv, one of the [`xts` vignettes](https://cran.r-project.org/web/packages/xts/vignettes/xts.pdf) shows how to coerce from data.frame to xts so all you have to do is to read in the data with `read.csv`. – Rui Barradas May 08 '21 at 18:52
  • I found the following : `library(devtools); install_github("https://github.com/jonathancornelissen/highfrequency")` from the Github repo. But, okay. I will try the `xts vignettes` one. Thank you. @RuiBarradas – Shahal May 08 '21 at 19:14
  • If you want to not load a package to use just once, `devtools::install_github("jonathancornelissen/highfrequency")` also works. – Rui Barradas May 08 '21 at 19:21
  • @RuiBarradas Can you please check this for reference: https://stackoverflow.com/questions/38326286/convert-csv-file-for-further-manipulation-using-highfrequency-package-on-r. I wonder why it is not working now. – Shahal May 08 '21 at 21:40

0 Answers0