datafest competition 2019
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
400 B

  1. fatigueFunction <- function(workLoad, index)
  2. {
  3. if(index == 1)
  4. {
  5. return(workLoad[1])
  6. }
  7. else
  8. {
  9. return(workLoad[index] + 0.7*fatigueFunction(workLoad, index -1))
  10. }
  11. }
  12. smoothVector <- function(dataV)
  13. {
  14. dataNew <- c()
  15. for(i in 1:length(dataV))
  16. {
  17. dataNew <- c(dataNew, fatigueFunction(dataV, i))
  18. }
  19. dataNew
  20. }
  21. smoothVector(c(1,2,3,4))
  22. plot(1:100, smoothVector(1:100))