Rens Zuurbier hace 9 años
padre
commit
d163f3b093
Se han modificado 1 ficheros con 16 adiciones y 62 borrados
  1. 16 62
      code/ankle.R

+ 16 - 62
code/ankle.R

@@ -1,77 +1,31 @@
 library(dplyr)
 
-
-WD <- getwd()
-
-
-CSV <- file.choose()
-
-CSV <- read.csv(CSV)
-
-# CONVERT
-converted_ <- NULL
-
-for(i in 1:(nrow(CSV) / 3)) {
-  x <- NULL
-  y <- NULL
-  z <- NULL
-  
-  if(i > 1) { i <- i * 3 - 2 }
-  
-  x <- CSV[i,]
-  y <- CSV[i+1,]
-  z <- CSV[i+2,]
-  #print(i)
-  cnv_ <- merge(x, y, all = TRUE, suffixes = c(".x", ".y"), by = "Time")
-  cnv_ <- merge(cnv_, z, all = TRUE, suffixes = c("", ".z"), by = "Time")
-  
-  if(i == 1) {
-    #print("CREATE")
-    converted_ <- cnv_
-  }
-  else {
-    #print("BIND")
-    converted_ <- bind_rows(converted_, cnv_)
-  }
-  
-}
-
 # For loop to add 1.1m to all the data of AnkleLeft.y to determine real height.
-#for (j in 1:(nrow(converted_))) {
-#  converted_$AnkleLeft.y + 1.1
+#for (j in 1:(nrow(DATA))) {
+#  DATA$AnkleLeft.y + 1.1
 #}
 
-lowestLeft <- min(converted_$AnkleLeft.y)
-lowestRight <- min(converted_$AnkleRight.y)
+lowestLeft <- min(DATA$AnkleLeft.y)
+lowestRight <- min(DATA$AnkleRight.y)
 
-highestLeft <- max(converted_$AnkleLeft.y)
-highestRight <- max(converted_$AnkleRight.y)
+highestLeft <- max(DATA$AnkleLeft.y)
+highestRight <- max(DATA$AnkleRight.y)
 
 VerschilLeft <- (lowestLeft - highestLeft)
 VerschilRight <- (lowestRight - highestRight)
 
 
 
-plot(converted_$AnkleLeft.y,
+plot(DATA$AnkleLeft.y,
      type = "l",
      ylab = "Hoogte...",
-     col = ifelse(converted_$AnkleLeft.y > -1.1, "green", "red"),
-     ylim = c(-1.20, -0.8)
+     col = ifelse(DATA$AnkleLeft.y > -1.1, "green", "red"),
+     ylim = c(-1.15, -0.80)
 )
-par(new=TRUE)
-plot(converted_$AnkleRight.y,
-     type = "l",
-     ylab = "Hoogte",
-     col = ifelse(converted_$AnkleRight.y > -1.1, "orange", "purple"),
-     ylim = c(-1.20, -0.8)
-)
-par(new=TRUE)
-plot(converted_$Head.y,
-     type = "l",
-     ylab = "Hoogte in M",
-     col = "blue",
-     ylim = c(-1.20, 0.70)
-)
-
-
-
+#par(new=TRUE)
+#plot(DATA$AnkleRight.y,
+#     type = "l",
+#     ylab = "Hoogte",
+#     col = ifelse(DATA$AnkleRight.y > -1.1, "orange", "purple"),
+#     ylim = c(-1.20, -0.8)
+#)