I've been trying to run the findDrawdowns
function in R from the PerformanceAnalytics package and kept getting a dimension error.
My data set is called dataset
and is a 200 rows, 1 column vector, with no NA in it. I've set up row names as dates as shown below
Here are my code lines:
timedate <- as.POSIXct(Date,format="%d/%m/%Y")
names(dataset) <- timedate
maxDD <- maxDrawdown(dataset,weights=FALSE,geometric=TRUE,invert=FALSE)
findDD <- findDrawdowns(dataset,geometric=TRUE)
Runing maxDrawdown
function works just fine, but the findDrawdowns
one always leaves me with :
Error in R[, 1, drop = FALSE] : incorrect number of dimensions
Is there any way I can change the data to make it fit or anything I shouldn't have missed about the function? Thanks