[R] Need Help in Debugging
istiyak ahamad
istiyak.mba at gmail.com
Wed Sep 27 23:34:07 CEST 2017
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)
run <- run$lengths
for(i in 1:(length(runsum)-1)){
if (runvalue[i]==FALSE){
left <- runsum[i-1]
right <- runsum[i+1]-(run[i+1]-1)
slope <- (dat$Close[dat$seq==right]-dat$Close[dat$seq==left])/(run[i]+1)
dat$fit[(left+1):(right-1)] <- seq(1:run[i])*slope+dat$Close[left]
}
return(dat)
}
Error in length(runsum) : object 'runsum' not found
Error in length(runsum) : object 'runsum' not found
[[alternative HTML version deleted]]
More information about the R-help
mailing list