One small help please. Based on the below code finally I have got the df0day. But now how can I see the predicted date along with the real data...
duinfo <- read.table('D:\DS Data\diskexportm906.csv',
col.names=c('computer','fullname','instance','day','type','gb','fullspace','usd','free','freepercent'),
colClasses = c("character","character","character","Date","character","numeric","numeric","numeric","numeric","numeric"))
attach(duinfo)
totalspace <- fullspace
today <- tail(day, 1)
dudelta <- diff(usd)
f <- function(spaceleft) {
days <- 0
while(spaceleft > 0) {
days <- days + 1
spaceleft <- spaceleft - sample(dudelta, 1, replace=TRUE)
}
days
}
freespace <- totalspace - tail(usd, 1)
daysleft <- replicate(5000, f(freespace))
plot(daysleft)
df0day <- sort(daysleft + today)
df0ecdfunc <- ecdf(df0day)
df0prob <- df0ecdfunc(df0day)
plot(df0day, df0prob, xaxt='n', type='l')
axis.Date(1, df0day, at=seq(min(df0day), max(df0day), 'year'), format='%F')