Dear All, I want to read the my time series data using XTS package and then to calculate return using PeformanceAnalytics Package but i am getting the following error. Please help me to solve the problem. The error follows:
# Required Libraries > library(xts) > library(PerformanceAnalytics) > > #Reading Data > x<-read.csv('crude.csv') > y<-xts(x[,1:2],as.numeric(x[,2:2]),order.by =as.Date(x[,1],format='%d-%b-%y')) > close <- y$close > > #Calculating Return > rspot = Return.calculate(close, method = c ("discrete")) Error in `/.default`(pr, lag(pr)) : non-numeric argument to binary operator I am not getting where i am committing the mistake. With sincere regards, Upananda -- You may delay, but time will not. Research Scholar alternative mail id: up...@iitkgp.ac.in Department of HSS, IIT KGP KGP
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.