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.

56 lines
1.4 KiB

  1. source("readData.R")
  2. library(tidyverse)
  3. # file to replace NA values with the median for thet column
  4. trainingData <- readRPEData()
  5. #duration
  6. trainingData$Duration[is.na(trainingData$Duration)] <- median(trainingData$Duration, na.rm=TRUE)
  7. print(trainingData$Duration)
  8. #RPE
  9. trainingData$RPE[is.na(trainingData$RPE)] <- median(trainingData$RPE, na.rm=TRUE)
  10. # acute load
  11. trainingData$AcuteLoad[is.na(trainingData$AcuteLoad)] <- median(trainingData$AcuteLoad, na.rm=TRUE)
  12. # chronic load
  13. trainingData$ChronicLoad[is.na(trainingData$ChronicLoad)] <- median(trainingData$ChronicLoad, na.rm=TRUE)
  14. # ratio
  15. trainingData$AcuteChronicRatio[is.na(trainingData$AcuteChronicRatio)] <- median(trainingData$AcuteChronicRatio, na.rm=TRUE)
  16. # objective rating
  17. trainingData$ObjectiveRating[is.na(trainingData$ObjectiveRating)] <- median(trainingData$ObjectiveRating, na.rm=TRUE)
  18. # focus rating
  19. trainingData$FocusRating[is.na(trainingData$FocusRating)] <- median(trainingData$FocusRating, na.rm=TRUE)
  20. # session load
  21. trainingData$SessionLoad[is.na(trainingData$SessionLoad)] <- median(trainingData$SessionLoad, na.rm=TRUE)
  22. # daily load
  23. trainingData$DailyLoad[is.na(trainingData$DailyLoad)] <- median(trainingData$DailyLoad, na.rm=TRUE)
  24. trainingData$RPE[is.na(trainingData$RPE)] <- median(trainingData$RPE, na.rm=TRUE)
  25. write.csv(as.data.frame(trainingData), "cleaned/time_series_rpe_NA_ReplacedWithMedian.csv")
  26. head(as.data.frame(trainingData), 100)
  27. trainingData