search for: daystoend

Displaying 1 result from an estimated 1 matches for "daystoend".

Did you mean: daystand
2011 Aug 23
0
Ideas for tricky subset of XTS object
...e to find a way to do this easier to generate a new object just containing the days I want. --------------------------------------- dayEnds <- endpoints(dataset, on="days") datasetEnd <- max(dayEnds) for( d in 1:ndays(dataset)){ day <- dataset[ (dayEnds[d]+1):dayEnds[d+1], ] daysToEnd <- round(as.numeric( index(dataset[datasetEnd]) - index(tail(day, n=1)) , unit="days" )) if(daysToEnd > 30|| daysToEnd < 10){ next; } # Will only get here if the days until the end are between 10 and 30 # Do the work here } -------------------------------------------...