I am trying to run the below code in rstudio. This is a part of code used in Disk Space prediction as mentioned in the link (Click Here)
When I run the below lines the execution is not stopping and I am seeing the STOP button for hours. No clue on whats going on...
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(5, f(freespace))