[R-SIG-Finance] Error in midnightStandard(charvec, format)
Wei-han Liu
weihanliu2002 at yahoo.com
Wed Jun 6 02:10:03 CEST 2012
Hi R users:
I am trying some functions in QRMlib
package and applying to my own trial dataset but encountered the following
error message when dealing with time series data.
Error in
midnightStandard(charvec, format) :
'charvec' has non-NA entries of different
number of characters
I have googled
for some solution but the discussions are not clear enough to me if the issue
can be solved or not. I suppose it is due to the data type conflict.
Listed below is the coding and dataset is attached:
dataset <-
read.csv("D:/stockindex.csv", header=TRUE, sep = ",");
tsData <-
as.timeSeries(dataset);
Date <-
tsData[,1];
SP500ts <-
tsData[,2];
SP500.nreturns
<- -mk.returns(SP500ts);
tD <-
timeDate("05/16/1992","%m/%d/%Y");
window <-
(seriesPositions(SP500.nreturns) > tD);SP500.nreturns <-
SP500.nreturns[window];
Thanks for your attention and assistance.
Wei-han
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120605/76639a71/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stockindex.csv
Type: application/octet-stream
Size: 4342 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20120605/76639a71/attachment.obj>
More information about the R-SIG-Finance
mailing list