My Kerbal RPC scripts

analysis.rmd 1.1KB

12345678910111213141516171819202122232425262728293031323334
  1. ---
  2. title: "Flight analysis"
  3. ---
  4. This file creates graphs of recorded flight parameters
  5. ```{r init}
  6. library(ggplot2)
  7. library(scales)
  8. flight <- read.csv("flight.csv", header=T)
  9. ```
  10. ```{r graph}
  11. baseg <- ggplot(flight, aes(x=timepoint / 10)) + xlab("Time (seconds)") + theme_classic()
  12. alt <- baseg + geom_line(aes(y=current_altitude)) + ylab("Altitude (m)") + ggtitle("Altitude")
  13. vspd <- baseg + geom_line(aes(y=v_speed)) + ylab("Vertical speed (m/s)") + ggtitle("Vertical speed")
  14. hspd <- baseg + geom_line(aes(y=h_speed)) + ylab("Horizontal speed (m/s)") + ggtitle("Horizontal speed")
  15. mass <- baseg + geom_line(aes(y=mass)) + ylab("Vessel mass (kg)") + ggtitle("Mass")
  16. fuel <- baseg + geom_line(aes(y=fuel)) + ylab("Fuel (kg)") + ggtitle("Fuel")
  17. at <- baseg + geom_line(aes(y=available_thrust)) + ylab("Available thrust (Newtons)") + ggtitle("Available thrust")
  18. thrust <- baseg + geom_line(aes(y=current_thrust)) + ylab("Current thrust (Newtons)") + ggtitle("Current thrust")
  19. g_force <- baseg + geom_line(aes(y=g_force)) + ylab("G-force (m/s²)") + ggtitle("G-force")
  20. ```
  21. ```{r drawgraphs, echo=FALSE}
  22. alt
  23. vspd
  24. hspd
  25. mass
  26. fuel
  27. at
  28. thrust
  29. g_force
  30. ```