[R] need held in r coding.

2017-09-27 Thread istiyak ahamad
Need Help in Debugging below script: dat <- get_majorlandmarks(dat,Dmin,Per) fit_xts <- xts(dat$fit,order.by = dat$Date,frequency = 365) close_xts <- xts(dat$Close, order.by = dat$Date, frequency = 365 ) majorlandmarks_xts <-xts(dat$Close[dat$majorlandmarks==TRUE]

[R] Need Help in Debugging

2017-09-27 Thread istiyak ahamad
I am getting following error when running this script :Error in length(runsum) : object 'runsum' not found ##error function dat$fit <- NULL dat$fit[dat$majorlandmarks] <- dat$Close[dat$majorlandmarks] run <- rle(dat$majorlandmarks) runvalue <- run$values runsum <- cumsum(run$lengths)