Browse Source

Prettify analysis document

Petra Lamborn 6 years ago
parent
commit
d7f7b4dd75
1 changed files with 10 additions and 5 deletions
  1. 10
    5
      analysis.rmd

+ 10
- 5
analysis.rmd View File

@@ -2,7 +2,7 @@
2 2
 title: "Flight analysis"
3 3
 ---
4 4
 
5
-This file creates graphs of recorded flight parameters
5
+This [R Markdown](http://rmarkdown.rstudio.com/) file creates graphs of recorded flight parameters, stored in `flight.csv` via the `monitor.py` Kerbal RPC script.
6 6
 
7 7
 ```{r opts, include=FALSE}
8 8
 library(knitr)
@@ -12,12 +12,20 @@ opts_chunk$set(tidy=TRUE)
12 12
 ```{r init}
13 13
 library(ggplot2)
14 14
 library(scales)
15
+library(broom)
15 16
 flight <- read.csv("flight.csv", header=T)
16 17
 flight$mission_time <- as.POSIXct(flight$mission_time, origin=Sys.Date(), tz="GMT")
17 18
 flight$orbit_period <- as.POSIXct(flight$orbit_period, origin=Sys.Date(), tz="GMT")
18 19
 ```
19 20
 
20
-```{r graph}
21
+Columns:
22
+
23
+```{r, echo=FALSE, results="asis"}
24
+cat(paste0("1. ", names(flight)), sep="\n")
25
+```
26
+
27
+```{r graph, message=FALSE}
28
+# Graphing logic
21 29
 baseg <- ggplot(flight, aes(x=mission_time)) + xlab("Time (H:M:S)") + theme_classic() + scale_x_datetime(date_labels="%H:%M:%S") + scale_y_continuous(labels=comma)
22 30
 alt <- baseg + geom_line(aes(y=current_altitude)) + ylab("Altitude (m)") + ggtitle("Altitude")
23 31
 vspd <- baseg + geom_line(aes(y=v_speed)) + ylab("Vertical speed (m/s)") + ggtitle("Vertical speed")
@@ -34,9 +42,6 @@ pa <- baseg + geom_line(aes(y=periapsis)) + ylab("Periapsis altitude (m)") + ggt
34 42
 orad <- baseg + geom_line(aes(y=orbital_radius)) + ylab("Orbital radius (m)") + ggtitle("Orbital radius")
35 43
 os <- baseg + geom_line(aes(y=orbit_speed)) + ylab("Orbital speed (m/s)") + ggtitle("Orbital speed")
36 44
 op <- baseg + geom_line(aes(y=orbit_period)) + ylab("Orbital period (H:M:S)") + ggtitle("Orbital period") + scale_y_datetime(date_labels="%H:%M:%S")
37
-
38
-
39
-
40 45
 ```
41 46
 
42 47
 ```{r drawgraphs, echo=FALSE}