Create a .CSV file (or optionally, a MySQL database!) that includes all of the information included in the dataset. You’re encouraged to use a “wide” structure similar to how the information appears in the discussion item, so that you can practice tidying and transformations as described below.
Read the information from your .CSV file into R, and use tidyr and dplyr as needed to tidy and transform your data.
Perform the analysis requested in the discussion item. Your code should be in an R Markdown file, posted to rpubs.com, and should include narrative descriptions of your data cleanup work, analysis, and conclusions.
Loading data from the csv file. Minus sings and empty spaces the data as well as string in numeric fields suggest that data was null or unavailable from the original source and therefore, unable of being predicted in its totality.
header <- c("Type","Model",1941:1951)
ww2_data <- read_csv("RawCost.csv", col_names = header,skip = 1,na = c("","-"))
Display of the dataframe read from the csv file.
ww2_data %>%
kable() %>%
kable_styling() %>%
scroll_box(width = "300")
| Type | Model | 1941 | 1942 | 1943 | 1944 | 1945 | 1946 | 1947 | 1948 | 1949 | 1950 | 1951 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Very Heavy Bombers | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | B-29 | NA | 897 | 730 | NA | 605 | 360 | 509 | 465 | NA | NA | NA |
| Heavy Bombers | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | B-17 | 301 | 221 | 258 | 949 | NA | 204 | 370 | 187 | 742 | NA | NA |
| NA | B-24 | 379 | 162 | 304 | 391 | NA | 215 | 516 | NA | NA | NA | NA |
| NA | B-32 | NA | 790 | 433 | NA | 790 | 433 | NA | NA | NA | NA | NA |
| Medium Bombers | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | B-25 | 180 | 31 | 153 | 396 | 151 | 894 | 142 | 194 | 116 | 752 | NA |
| NA | B-26 | 261 | 62 | 239 | 655 | 212 | 932 | 192 | 427 | NA | NA | NA |
| Light Bombers | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | A-20 | 136 | 813 | 124 | 254 | 110 | 324 | 100 | 800 | NA | NA | NA |
| NA | A-26 | 224 | 498 | NA | 254 | 624 | 192 | 457 | 175 | 892 | NA | NA |
| NA | A-28 | NA | 118 | 704 | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | A-29 | NA | 118 | 80 | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | A-30 | NA | 155 | 570 | 151 | 17 | NA | NA | NA | NA | NA | NA |
| Fighters | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | P-38 | 132 | 284 | 120 | 407 | 105 | 567 | 97 | 147 | NA | NA | NA |
| NA | P-39 | 77 | 159 | 69 | 534 | NA | 50 | 666 | NA | NA | NA | NA |
| NA | P-40 | 60 | 562 | 59 | 444 | 49 | 449 | 44 | 892 | NA | NA | NA |
| NA | P-47 | 113 | 246 | 105 | 594 | 104 | 258 | 85 | 578 | 83 | 83 | NA |
| NA | P-51 | NA | 58 | 698 | 58 | 824 | 51 | 572 | 50 | 985 | NA | NA |
| NA | P-59 | NA | NA | NA | 236 | 299 | NA | NA | NA | NA | NA | NA |
| NA | P-61 | 649 | 584 | 245 | 327 | 180 | 711 | NA | 199 | 598 | NA | NA |
| NA | P-63 | NA | 60 | 277 | 57 | 379 | 59 | 966 | 65 | 914 | NA | NA |
| NA | P-70 | 143 | 76 | NA | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | P-80 | NA | NA | NA | 109 | 471 | 71 | 840 | NA | NA | NA | NA |
| Reconnaissance | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | OA-10 | 222 | 799 | NA | NA | 216 | 617 | 207 | 541 | NA | NA | NA |
| Transports | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | C-43 | NA | 49 | 524 | 27 | 342 | 27 | 332 | NA | NA | NA | NA |
| NA | C-45 | 67 | 743 | NA | 66 | 189 | 52 | 507 | 48 | 830 | NA | NA |
| NA | C-46 | 341 | 831 | 314 | 700 | 259 | 268 | 233 | 377 | 221 | 550 | NA |
| NA | C-47 | 128 | 761 | 109 | 696 | 92 | 417 | 88 | 574 | 85 | 35 | NA |
| NA | C-53 | 136 | 6999 | 143 | 479 | 150 | 470 | NA | NA | NA | NA | NA |
| NA | C-54 | 516 | 553 | 370 | 492 | 400 | 831 | 285 | 113 | 259 | 816 | NA |
| NA | C-60 | NA | 126 | 881 | 113 | 168 | NA | NA | NA | NA | NA | NA |
| NA | C-61 | NA | 12 | 208 | 13 | 57 | 15 | 973 | NA | NA | NA | NA |
| NA | UC-64 | NA | NA | 36 | 811 | 35 | 264 | 32 | 427 | NA | NA | NA |
| NA | C-69 | NA | NA | 605 | 456 | NA | NA | NA | NA | NA | NA | NA |
| NA | C-74 | NA | 1 | 213 | 445 | NA | NA | NA | NA | NA | NA | NA |
| NA | C-78 | NA | 27 | 470 | 33 | 797 | NA | NA | NA | NA | NA | NA |
| NA | C-82 | NA | NA | NA | 478 | 549 | 310 | 233 | NA | NA | NA | NA |
| NA | C-87 | NA | NA | NA | 208 | 780 | NA | NA | NA | NA | NA | NA |
| Trainers | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | PT-13 | PT-17 | PT-27 | 10 | 22 | 9 | 896 | NA | NA | NA | NA | NA |
| NA | PT-19 | PT-23 | PT-26 | 9 | 710 | 12 | 911 | 11 | 100 | 15 | 52 | NA |
| NA | BT-13 | BT-15 | 25 | 35 | 23 | 68 | NA | NA | NA | NA | NA | NA |
| NA | AT-6 | 29 | 423 | 25 | 672 | NA | 22 | 952 | NA | NA | NA | NA |
| NA | AT-7 | AT-11 | 76 | 827 | 85 | 688 | 68 | 441 | NA | NA | NA | NA |
| NA | AT-8 | AT-17 | 41 | 701 | 34 | 323 | NA | NA | NA | NA | NA | NA |
| NA | AT-9 | 44 | 321 | 44 | 392 | NA | NA | NA | NA | NA | NA | NA |
| NA | AT-10 | 43 | 501 | 42 | 688 | NA | NA | NA | NA | NA | NA | NA |
| NA | AT-16 | NA | 27 | 564 | 27 | 416 | NA | NA | NA | NA | NA | NA |
| NA | AT-19 | NA | 26 | 574 | 22 | 496 | NA | NA | NA | NA | NA | NA |
| NA | AT-21 | NA | 92 | 295 | NA | NA | NA | NA | NA | NA | NA | NA |
| Communications | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | L-1 | 25 | 419 | NA | NA | NA | NA | NA | NA | NA | NA | NA |
| NA | L-2 | NA | 2 | 770 | 2 | 916 | NA | NA | NA | NA | NA | NA |
| NA | L-3 | NA | 2 | 236 | 2 | 460 | NA | NA | NA | NA | NA | NA |
| NA | L-4 | NA | 2 | 432 | 2 | 437 | 2 | 620 | 2 | 701 | NA | NA |
| NA | L-5 | NA | 10 | 165 | NA | 9 | 704 | 8 | 323 | NA | NA | NA |
| NA | L-6 | NA | NA | 6 | 65 | NA | NA | NA | NA | NA | NA | NA |
| NA | R-4 | NA | NA | 43 | 584 | NA | NA | NA | NA | NA | NA | NA |
| NA | R-5 | TR-5 | NA | NA | 59 | 488 | 50 | 950 | NA | NA | NA | NA |
| NA | R-6 | NA | NA | 47 | 635 | NA | NA | NA | NA | NA | NA | NA |
For cleaning this dataset, the column year were collapsed and the price column used for storing the value of such planes. then the columns corresponding to a type of plane that are missing are populated using the fill function to fill the empty rows with the value of the previous cell that was not empty.In this way the information will look complete. Finally, since this csv file came from an very old document that dates from the WW2, lots of data is missing in addition to incomplete information about values of certain fields, therefore, I am removing them from the data frame.
ww2_cl <- ww2_data %>%
gather("Year","Price",3:13) %>%
fill(Type,.direction = "down") %>%
filter(Model != "N/A")
This table displays each type of flight with its corresponding model, year and price.
ww2_cl %>%
kable() %>%
kable_styling() %>%
scroll_box(width = "100%",height = "320px")
| Type | Model | Year | Price |
|---|---|---|---|
| Very Heavy Bombers | B-29 | 1941 | NA |
| Heavy Bombers | B-17 | 1941 | 301 |
| Heavy Bombers | B-24 | 1941 | 379 |
| Heavy Bombers | B-32 | 1941 | NA |
| Medium Bombers | B-25 | 1941 | 180 |
| Medium Bombers | B-26 | 1941 | 261 |
| Light Bombers | A-20 | 1941 | 136 |
| Light Bombers | A-26 | 1941 | 224 |
| Light Bombers | A-28 | 1941 | NA |
| Light Bombers | A-29 | 1941 | NA |
| Light Bombers | A-30 | 1941 | NA |
| Fighters | P-38 | 1941 | 132 |
| Fighters | P-39 | 1941 | 77 |
| Fighters | P-40 | 1941 | 60 |
| Fighters | P-47 | 1941 | 113 |
| Fighters | P-51 | 1941 | NA |
| Fighters | P-59 | 1941 | NA |
| Fighters | P-61 | 1941 | 649 |
| Fighters | P-63 | 1941 | NA |
| Fighters | P-70 | 1941 | 143 |
| Fighters | P-80 | 1941 | NA |
| Reconnaissance | OA-10 | 1941 | 222 |
| Transports | C-43 | 1941 | NA |
| Transports | C-45 | 1941 | 67 |
| Transports | C-46 | 1941 | 341 |
| Transports | C-47 | 1941 | 128 |
| Transports | C-53 | 1941 | 136 |
| Transports | C-54 | 1941 | 516 |
| Transports | C-60 | 1941 | NA |
| Transports | C-61 | 1941 | NA |
| Transports | UC-64 | 1941 | NA |
| Transports | C-69 | 1941 | NA |
| Transports | C-74 | 1941 | NA |
| Transports | C-78 | 1941 | NA |
| Transports | C-82 | 1941 | NA |
| Transports | C-87 | 1941 | NA |
| Trainers | PT-13 | 1941 | PT-17 |
| Trainers | PT-19 | 1941 | PT-23 |
| Trainers | BT-13 | 1941 | BT-15 |
| Trainers | AT-6 | 1941 | 29 |
| Trainers | AT-7 | 1941 | AT-11 |
| Trainers | AT-8 | 1941 | AT-17 |
| Trainers | AT-9 | 1941 | 44 |
| Trainers | AT-10 | 1941 | 43 |
| Trainers | AT-16 | 1941 | NA |
| Trainers | AT-19 | 1941 | NA |
| Trainers | AT-21 | 1941 | NA |
| Communications | L-1 | 1941 | 25 |
| Communications | L-2 | 1941 | NA |
| Communications | L-3 | 1941 | NA |
| Communications | L-4 | 1941 | NA |
| Communications | L-5 | 1941 | NA |
| Communications | L-6 | 1941 | NA |
| Communications | R-4 | 1941 | NA |
| Communications | R-5 | 1941 | TR-5 |
| Communications | R-6 | 1941 | NA |
| Very Heavy Bombers | B-29 | 1942 | 897 |
| Heavy Bombers | B-17 | 1942 | 221 |
| Heavy Bombers | B-24 | 1942 | 162 |
| Heavy Bombers | B-32 | 1942 | 790 |
| Medium Bombers | B-25 | 1942 | 31 |
| Medium Bombers | B-26 | 1942 | 62 |
| Light Bombers | A-20 | 1942 | 813 |
| Light Bombers | A-26 | 1942 | 498 |
| Light Bombers | A-28 | 1942 | 118 |
| Light Bombers | A-29 | 1942 | 118 |
| Light Bombers | A-30 | 1942 | 155 |
| Fighters | P-38 | 1942 | 284 |
| Fighters | P-39 | 1942 | 159 |
| Fighters | P-40 | 1942 | 562 |
| Fighters | P-47 | 1942 | 246 |
| Fighters | P-51 | 1942 | 58 |
| Fighters | P-59 | 1942 | NA |
| Fighters | P-61 | 1942 | 584 |
| Fighters | P-63 | 1942 | 60 |
| Fighters | P-70 | 1942 | 76 |
| Fighters | P-80 | 1942 | NA |
| Reconnaissance | OA-10 | 1942 | 799 |
| Transports | C-43 | 1942 | 49 |
| Transports | C-45 | 1942 | 743 |
| Transports | C-46 | 1942 | 831 |
| Transports | C-47 | 1942 | 761 |
| Transports | C-53 | 1942 | 6999 |
| Transports | C-54 | 1942 | 553 |
| Transports | C-60 | 1942 | 126 |
| Transports | C-61 | 1942 | 12 |
| Transports | UC-64 | 1942 | NA |
| Transports | C-69 | 1942 | NA |
| Transports | C-74 | 1942 | 1 |
| Transports | C-78 | 1942 | 27 |
| Transports | C-82 | 1942 | NA |
| Transports | C-87 | 1942 | NA |
| Trainers | PT-13 | 1942 | PT-27 |
| Trainers | PT-19 | 1942 | PT-26 |
| Trainers | BT-13 | 1942 | 25 |
| Trainers | AT-6 | 1942 | 423 |
| Trainers | AT-7 | 1942 | 76 |
| Trainers | AT-8 | 1942 | 41 |
| Trainers | AT-9 | 1942 | 321 |
| Trainers | AT-10 | 1942 | 501 |
| Trainers | AT-16 | 1942 | 27 |
| Trainers | AT-19 | 1942 | 26 |
| Trainers | AT-21 | 1942 | 92 |
| Communications | L-1 | 1942 | 419 |
| Communications | L-2 | 1942 | 2 |
| Communications | L-3 | 1942 | 2 |
| Communications | L-4 | 1942 | 2 |
| Communications | L-5 | 1942 | 10 |
| Communications | L-6 | 1942 | NA |
| Communications | R-4 | 1942 | NA |
| Communications | R-5 | 1942 | NA |
| Communications | R-6 | 1942 | NA |
| Very Heavy Bombers | B-29 | 1943 | 730 |
| Heavy Bombers | B-17 | 1943 | 258 |
| Heavy Bombers | B-24 | 1943 | 304 |
| Heavy Bombers | B-32 | 1943 | 433 |
| Medium Bombers | B-25 | 1943 | 153 |
| Medium Bombers | B-26 | 1943 | 239 |
| Light Bombers | A-20 | 1943 | 124 |
| Light Bombers | A-26 | 1943 | NA |
| Light Bombers | A-28 | 1943 | 704 |
| Light Bombers | A-29 | 1943 | 80 |
| Light Bombers | A-30 | 1943 | 570 |
| Fighters | P-38 | 1943 | 120 |
| Fighters | P-39 | 1943 | 69 |
| Fighters | P-40 | 1943 | 59 |
| Fighters | P-47 | 1943 | 105 |
| Fighters | P-51 | 1943 | 698 |
| Fighters | P-59 | 1943 | NA |
| Fighters | P-61 | 1943 | 245 |
| Fighters | P-63 | 1943 | 277 |
| Fighters | P-70 | 1943 | NA |
| Fighters | P-80 | 1943 | NA |
| Reconnaissance | OA-10 | 1943 | NA |
| Transports | C-43 | 1943 | 524 |
| Transports | C-45 | 1943 | NA |
| Transports | C-46 | 1943 | 314 |
| Transports | C-47 | 1943 | 109 |
| Transports | C-53 | 1943 | 143 |
| Transports | C-54 | 1943 | 370 |
| Transports | C-60 | 1943 | 881 |
| Transports | C-61 | 1943 | 208 |
| Transports | UC-64 | 1943 | 36 |
| Transports | C-69 | 1943 | 605 |
| Transports | C-74 | 1943 | 213 |
| Transports | C-78 | 1943 | 470 |
| Transports | C-82 | 1943 | NA |
| Transports | C-87 | 1943 | NA |
| Trainers | PT-13 | 1943 | 10 |
| Trainers | PT-19 | 1943 | 9 |
| Trainers | BT-13 | 1943 | 35 |
| Trainers | AT-6 | 1943 | 25 |
| Trainers | AT-7 | 1943 | 827 |
| Trainers | AT-8 | 1943 | 701 |
| Trainers | AT-9 | 1943 | 44 |
| Trainers | AT-10 | 1943 | 42 |
| Trainers | AT-16 | 1943 | 564 |
| Trainers | AT-19 | 1943 | 574 |
| Trainers | AT-21 | 1943 | 295 |
| Communications | L-1 | 1943 | NA |
| Communications | L-2 | 1943 | 770 |
| Communications | L-3 | 1943 | 236 |
| Communications | L-4 | 1943 | 432 |
| Communications | L-5 | 1943 | 165 |
| Communications | L-6 | 1943 | 6 |
| Communications | R-4 | 1943 | 43 |
| Communications | R-5 | 1943 | NA |
| Communications | R-6 | 1943 | 47 |
| Very Heavy Bombers | B-29 | 1944 | NA |
| Heavy Bombers | B-17 | 1944 | 949 |
| Heavy Bombers | B-24 | 1944 | 391 |
| Heavy Bombers | B-32 | 1944 | NA |
| Medium Bombers | B-25 | 1944 | 396 |
| Medium Bombers | B-26 | 1944 | 655 |
| Light Bombers | A-20 | 1944 | 254 |
| Light Bombers | A-26 | 1944 | 254 |
| Light Bombers | A-28 | 1944 | NA |
| Light Bombers | A-29 | 1944 | NA |
| Light Bombers | A-30 | 1944 | 151 |
| Fighters | P-38 | 1944 | 407 |
| Fighters | P-39 | 1944 | 534 |
| Fighters | P-40 | 1944 | 444 |
| Fighters | P-47 | 1944 | 594 |
| Fighters | P-51 | 1944 | 58 |
| Fighters | P-59 | 1944 | 236 |
| Fighters | P-61 | 1944 | 327 |
| Fighters | P-63 | 1944 | 57 |
| Fighters | P-70 | 1944 | NA |
| Fighters | P-80 | 1944 | 109 |
| Reconnaissance | OA-10 | 1944 | NA |
| Transports | C-43 | 1944 | 27 |
| Transports | C-45 | 1944 | 66 |
| Transports | C-46 | 1944 | 700 |
| Transports | C-47 | 1944 | 696 |
| Transports | C-53 | 1944 | 479 |
| Transports | C-54 | 1944 | 492 |
| Transports | C-60 | 1944 | 113 |
| Transports | C-61 | 1944 | 13 |
| Transports | UC-64 | 1944 | 811 |
| Transports | C-69 | 1944 | 456 |
| Transports | C-74 | 1944 | 445 |
| Transports | C-78 | 1944 | 33 |
| Transports | C-82 | 1944 | 478 |
| Transports | C-87 | 1944 | 208 |
| Trainers | PT-13 | 1944 | 22 |
| Trainers | PT-19 | 1944 | 710 |
| Trainers | BT-13 | 1944 | 23 |
| Trainers | AT-6 | 1944 | 672 |
| Trainers | AT-7 | 1944 | 85 |
| Trainers | AT-8 | 1944 | 34 |
| Trainers | AT-9 | 1944 | 392 |
| Trainers | AT-10 | 1944 | 688 |
| Trainers | AT-16 | 1944 | 27 |
| Trainers | AT-19 | 1944 | 22 |
| Trainers | AT-21 | 1944 | NA |
| Communications | L-1 | 1944 | NA |
| Communications | L-2 | 1944 | 2 |
| Communications | L-3 | 1944 | 2 |
| Communications | L-4 | 1944 | 2 |
| Communications | L-5 | 1944 | NA |
| Communications | L-6 | 1944 | 65 |
| Communications | R-4 | 1944 | 584 |
| Communications | R-5 | 1944 | 59 |
| Communications | R-6 | 1944 | 635 |
| Very Heavy Bombers | B-29 | 1945 | 605 |
| Heavy Bombers | B-17 | 1945 | NA |
| Heavy Bombers | B-24 | 1945 | NA |
| Heavy Bombers | B-32 | 1945 | 790 |
| Medium Bombers | B-25 | 1945 | 151 |
| Medium Bombers | B-26 | 1945 | 212 |
| Light Bombers | A-20 | 1945 | 110 |
| Light Bombers | A-26 | 1945 | 624 |
| Light Bombers | A-28 | 1945 | NA |
| Light Bombers | A-29 | 1945 | NA |
| Light Bombers | A-30 | 1945 | 17 |
| Fighters | P-38 | 1945 | 105 |
| Fighters | P-39 | 1945 | NA |
| Fighters | P-40 | 1945 | 49 |
| Fighters | P-47 | 1945 | 104 |
| Fighters | P-51 | 1945 | 824 |
| Fighters | P-59 | 1945 | 299 |
| Fighters | P-61 | 1945 | 180 |
| Fighters | P-63 | 1945 | 379 |
| Fighters | P-70 | 1945 | NA |
| Fighters | P-80 | 1945 | 471 |
| Reconnaissance | OA-10 | 1945 | 216 |
| Transports | C-43 | 1945 | 342 |
| Transports | C-45 | 1945 | 189 |
| Transports | C-46 | 1945 | 259 |
| Transports | C-47 | 1945 | 92 |
| Transports | C-53 | 1945 | 150 |
| Transports | C-54 | 1945 | 400 |
| Transports | C-60 | 1945 | 168 |
| Transports | C-61 | 1945 | 57 |
| Transports | UC-64 | 1945 | 35 |
| Transports | C-69 | 1945 | NA |
| Transports | C-74 | 1945 | NA |
| Transports | C-78 | 1945 | 797 |
| Transports | C-82 | 1945 | 549 |
| Transports | C-87 | 1945 | 780 |
| Trainers | PT-13 | 1945 | 9 |
| Trainers | PT-19 | 1945 | 12 |
| Trainers | BT-13 | 1945 | 68 |
| Trainers | AT-6 | 1945 | NA |
| Trainers | AT-7 | 1945 | 688 |
| Trainers | AT-8 | 1945 | 323 |
| Trainers | AT-9 | 1945 | NA |
| Trainers | AT-10 | 1945 | NA |
| Trainers | AT-16 | 1945 | 416 |
| Trainers | AT-19 | 1945 | 496 |
| Trainers | AT-21 | 1945 | NA |
| Communications | L-1 | 1945 | NA |
| Communications | L-2 | 1945 | 916 |
| Communications | L-3 | 1945 | 460 |
| Communications | L-4 | 1945 | 437 |
| Communications | L-5 | 1945 | 9 |
| Communications | L-6 | 1945 | NA |
| Communications | R-4 | 1945 | NA |
| Communications | R-5 | 1945 | 488 |
| Communications | R-6 | 1945 | NA |
| Very Heavy Bombers | B-29 | 1946 | 360 |
| Heavy Bombers | B-17 | 1946 | 204 |
| Heavy Bombers | B-24 | 1946 | 215 |
| Heavy Bombers | B-32 | 1946 | 433 |
| Medium Bombers | B-25 | 1946 | 894 |
| Medium Bombers | B-26 | 1946 | 932 |
| Light Bombers | A-20 | 1946 | 324 |
| Light Bombers | A-26 | 1946 | 192 |
| Light Bombers | A-28 | 1946 | NA |
| Light Bombers | A-29 | 1946 | NA |
| Light Bombers | A-30 | 1946 | NA |
| Fighters | P-38 | 1946 | 567 |
| Fighters | P-39 | 1946 | 50 |
| Fighters | P-40 | 1946 | 449 |
| Fighters | P-47 | 1946 | 258 |
| Fighters | P-51 | 1946 | 51 |
| Fighters | P-59 | 1946 | NA |
| Fighters | P-61 | 1946 | 711 |
| Fighters | P-63 | 1946 | 59 |
| Fighters | P-70 | 1946 | NA |
| Fighters | P-80 | 1946 | 71 |
| Reconnaissance | OA-10 | 1946 | 617 |
| Transports | C-43 | 1946 | 27 |
| Transports | C-45 | 1946 | 52 |
| Transports | C-46 | 1946 | 268 |
| Transports | C-47 | 1946 | 417 |
| Transports | C-53 | 1946 | 470 |
| Transports | C-54 | 1946 | 831 |
| Transports | C-60 | 1946 | NA |
| Transports | C-61 | 1946 | 15 |
| Transports | UC-64 | 1946 | 264 |
| Transports | C-69 | 1946 | NA |
| Transports | C-74 | 1946 | NA |
| Transports | C-78 | 1946 | NA |
| Transports | C-82 | 1946 | 310 |
| Transports | C-87 | 1946 | NA |
| Trainers | PT-13 | 1946 | 896 |
| Trainers | PT-19 | 1946 | 911 |
| Trainers | BT-13 | 1946 | NA |
| Trainers | AT-6 | 1946 | 22 |
| Trainers | AT-7 | 1946 | 68 |
| Trainers | AT-8 | 1946 | NA |
| Trainers | AT-9 | 1946 | NA |
| Trainers | AT-10 | 1946 | NA |
| Trainers | AT-16 | 1946 | NA |
| Trainers | AT-19 | 1946 | NA |
| Trainers | AT-21 | 1946 | NA |
| Communications | L-1 | 1946 | NA |
| Communications | L-2 | 1946 | NA |
| Communications | L-3 | 1946 | NA |
| Communications | L-4 | 1946 | 2 |
| Communications | L-5 | 1946 | 704 |
| Communications | L-6 | 1946 | NA |
| Communications | R-4 | 1946 | NA |
| Communications | R-5 | 1946 | 50 |
| Communications | R-6 | 1946 | NA |
| Very Heavy Bombers | B-29 | 1947 | 509 |
| Heavy Bombers | B-17 | 1947 | 370 |
| Heavy Bombers | B-24 | 1947 | 516 |
| Heavy Bombers | B-32 | 1947 | NA |
| Medium Bombers | B-25 | 1947 | 142 |
| Medium Bombers | B-26 | 1947 | 192 |
| Light Bombers | A-20 | 1947 | 100 |
| Light Bombers | A-26 | 1947 | 457 |
| Light Bombers | A-28 | 1947 | NA |
| Light Bombers | A-29 | 1947 | NA |
| Light Bombers | A-30 | 1947 | NA |
| Fighters | P-38 | 1947 | 97 |
| Fighters | P-39 | 1947 | 666 |
| Fighters | P-40 | 1947 | 44 |
| Fighters | P-47 | 1947 | 85 |
| Fighters | P-51 | 1947 | 572 |
| Fighters | P-59 | 1947 | NA |
| Fighters | P-61 | 1947 | NA |
| Fighters | P-63 | 1947 | 966 |
| Fighters | P-70 | 1947 | NA |
| Fighters | P-80 | 1947 | 840 |
| Reconnaissance | OA-10 | 1947 | 207 |
| Transports | C-43 | 1947 | 332 |
| Transports | C-45 | 1947 | 507 |
| Transports | C-46 | 1947 | 233 |
| Transports | C-47 | 1947 | 88 |
| Transports | C-53 | 1947 | NA |
| Transports | C-54 | 1947 | 285 |
| Transports | C-60 | 1947 | NA |
| Transports | C-61 | 1947 | 973 |
| Transports | UC-64 | 1947 | 32 |
| Transports | C-69 | 1947 | NA |
| Transports | C-74 | 1947 | NA |
| Transports | C-78 | 1947 | NA |
| Transports | C-82 | 1947 | 233 |
| Transports | C-87 | 1947 | NA |
| Trainers | PT-13 | 1947 | NA |
| Trainers | PT-19 | 1947 | 11 |
| Trainers | BT-13 | 1947 | NA |
| Trainers | AT-6 | 1947 | 952 |
| Trainers | AT-7 | 1947 | 441 |
| Trainers | AT-8 | 1947 | NA |
| Trainers | AT-9 | 1947 | NA |
| Trainers | AT-10 | 1947 | NA |
| Trainers | AT-16 | 1947 | NA |
| Trainers | AT-19 | 1947 | NA |
| Trainers | AT-21 | 1947 | NA |
| Communications | L-1 | 1947 | NA |
| Communications | L-2 | 1947 | NA |
| Communications | L-3 | 1947 | NA |
| Communications | L-4 | 1947 | 620 |
| Communications | L-5 | 1947 | 8 |
| Communications | L-6 | 1947 | NA |
| Communications | R-4 | 1947 | NA |
| Communications | R-5 | 1947 | 950 |
| Communications | R-6 | 1947 | NA |
| Very Heavy Bombers | B-29 | 1948 | 465 |
| Heavy Bombers | B-17 | 1948 | 187 |
| Heavy Bombers | B-24 | 1948 | NA |
| Heavy Bombers | B-32 | 1948 | NA |
| Medium Bombers | B-25 | 1948 | 194 |
| Medium Bombers | B-26 | 1948 | 427 |
| Light Bombers | A-20 | 1948 | 800 |
| Light Bombers | A-26 | 1948 | 175 |
| Light Bombers | A-28 | 1948 | NA |
| Light Bombers | A-29 | 1948 | NA |
| Light Bombers | A-30 | 1948 | NA |
| Fighters | P-38 | 1948 | 147 |
| Fighters | P-39 | 1948 | NA |
| Fighters | P-40 | 1948 | 892 |
| Fighters | P-47 | 1948 | 578 |
| Fighters | P-51 | 1948 | 50 |
| Fighters | P-59 | 1948 | NA |
| Fighters | P-61 | 1948 | 199 |
| Fighters | P-63 | 1948 | 65 |
| Fighters | P-70 | 1948 | NA |
| Fighters | P-80 | 1948 | NA |
| Reconnaissance | OA-10 | 1948 | 541 |
| Transports | C-43 | 1948 | NA |
| Transports | C-45 | 1948 | 48 |
| Transports | C-46 | 1948 | 377 |
| Transports | C-47 | 1948 | 574 |
| Transports | C-53 | 1948 | NA |
| Transports | C-54 | 1948 | 113 |
| Transports | C-60 | 1948 | NA |
| Transports | C-61 | 1948 | NA |
| Transports | UC-64 | 1948 | 427 |
| Transports | C-69 | 1948 | NA |
| Transports | C-74 | 1948 | NA |
| Transports | C-78 | 1948 | NA |
| Transports | C-82 | 1948 | NA |
| Transports | C-87 | 1948 | NA |
| Trainers | PT-13 | 1948 | NA |
| Trainers | PT-19 | 1948 | 100 |
| Trainers | BT-13 | 1948 | NA |
| Trainers | AT-6 | 1948 | NA |
| Trainers | AT-7 | 1948 | NA |
| Trainers | AT-8 | 1948 | NA |
| Trainers | AT-9 | 1948 | NA |
| Trainers | AT-10 | 1948 | NA |
| Trainers | AT-16 | 1948 | NA |
| Trainers | AT-19 | 1948 | NA |
| Trainers | AT-21 | 1948 | NA |
| Communications | L-1 | 1948 | NA |
| Communications | L-2 | 1948 | NA |
| Communications | L-3 | 1948 | NA |
| Communications | L-4 | 1948 | 2 |
| Communications | L-5 | 1948 | 323 |
| Communications | L-6 | 1948 | NA |
| Communications | R-4 | 1948 | NA |
| Communications | R-5 | 1948 | NA |
| Communications | R-6 | 1948 | NA |
| Very Heavy Bombers | B-29 | 1949 | NA |
| Heavy Bombers | B-17 | 1949 | 742 |
| Heavy Bombers | B-24 | 1949 | NA |
| Heavy Bombers | B-32 | 1949 | NA |
| Medium Bombers | B-25 | 1949 | 116 |
| Medium Bombers | B-26 | 1949 | NA |
| Light Bombers | A-20 | 1949 | NA |
| Light Bombers | A-26 | 1949 | 892 |
| Light Bombers | A-28 | 1949 | NA |
| Light Bombers | A-29 | 1949 | NA |
| Light Bombers | A-30 | 1949 | NA |
| Fighters | P-38 | 1949 | NA |
| Fighters | P-39 | 1949 | NA |
| Fighters | P-40 | 1949 | NA |
| Fighters | P-47 | 1949 | 83 |
| Fighters | P-51 | 1949 | 985 |
| Fighters | P-59 | 1949 | NA |
| Fighters | P-61 | 1949 | 598 |
| Fighters | P-63 | 1949 | 914 |
| Fighters | P-70 | 1949 | NA |
| Fighters | P-80 | 1949 | NA |
| Reconnaissance | OA-10 | 1949 | NA |
| Transports | C-43 | 1949 | NA |
| Transports | C-45 | 1949 | 830 |
| Transports | C-46 | 1949 | 221 |
| Transports | C-47 | 1949 | 85 |
| Transports | C-53 | 1949 | NA |
| Transports | C-54 | 1949 | 259 |
| Transports | C-60 | 1949 | NA |
| Transports | C-61 | 1949 | NA |
| Transports | UC-64 | 1949 | NA |
| Transports | C-69 | 1949 | NA |
| Transports | C-74 | 1949 | NA |
| Transports | C-78 | 1949 | NA |
| Transports | C-82 | 1949 | NA |
| Transports | C-87 | 1949 | NA |
| Trainers | PT-13 | 1949 | NA |
| Trainers | PT-19 | 1949 | 15 |
| Trainers | BT-13 | 1949 | NA |
| Trainers | AT-6 | 1949 | NA |
| Trainers | AT-7 | 1949 | NA |
| Trainers | AT-8 | 1949 | NA |
| Trainers | AT-9 | 1949 | NA |
| Trainers | AT-10 | 1949 | NA |
| Trainers | AT-16 | 1949 | NA |
| Trainers | AT-19 | 1949 | NA |
| Trainers | AT-21 | 1949 | NA |
| Communications | L-1 | 1949 | NA |
| Communications | L-2 | 1949 | NA |
| Communications | L-3 | 1949 | NA |
| Communications | L-4 | 1949 | 701 |
| Communications | L-5 | 1949 | NA |
| Communications | L-6 | 1949 | NA |
| Communications | R-4 | 1949 | NA |
| Communications | R-5 | 1949 | NA |
| Communications | R-6 | 1949 | NA |
| Very Heavy Bombers | B-29 | 1950 | NA |
| Heavy Bombers | B-17 | 1950 | NA |
| Heavy Bombers | B-24 | 1950 | NA |
| Heavy Bombers | B-32 | 1950 | NA |
| Medium Bombers | B-25 | 1950 | 752 |
| Medium Bombers | B-26 | 1950 | NA |
| Light Bombers | A-20 | 1950 | NA |
| Light Bombers | A-26 | 1950 | NA |
| Light Bombers | A-28 | 1950 | NA |
| Light Bombers | A-29 | 1950 | NA |
| Light Bombers | A-30 | 1950 | NA |
| Fighters | P-38 | 1950 | NA |
| Fighters | P-39 | 1950 | NA |
| Fighters | P-40 | 1950 | NA |
| Fighters | P-47 | 1950 | 83 |
| Fighters | P-51 | 1950 | NA |
| Fighters | P-59 | 1950 | NA |
| Fighters | P-61 | 1950 | NA |
| Fighters | P-63 | 1950 | NA |
| Fighters | P-70 | 1950 | NA |
| Fighters | P-80 | 1950 | NA |
| Reconnaissance | OA-10 | 1950 | NA |
| Transports | C-43 | 1950 | NA |
| Transports | C-45 | 1950 | NA |
| Transports | C-46 | 1950 | 550 |
| Transports | C-47 | 1950 | 35 |
| Transports | C-53 | 1950 | NA |
| Transports | C-54 | 1950 | 816 |
| Transports | C-60 | 1950 | NA |
| Transports | C-61 | 1950 | NA |
| Transports | UC-64 | 1950 | NA |
| Transports | C-69 | 1950 | NA |
| Transports | C-74 | 1950 | NA |
| Transports | C-78 | 1950 | NA |
| Transports | C-82 | 1950 | NA |
| Transports | C-87 | 1950 | NA |
| Trainers | PT-13 | 1950 | NA |
| Trainers | PT-19 | 1950 | 52 |
| Trainers | BT-13 | 1950 | NA |
| Trainers | AT-6 | 1950 | NA |
| Trainers | AT-7 | 1950 | NA |
| Trainers | AT-8 | 1950 | NA |
| Trainers | AT-9 | 1950 | NA |
| Trainers | AT-10 | 1950 | NA |
| Trainers | AT-16 | 1950 | NA |
| Trainers | AT-19 | 1950 | NA |
| Trainers | AT-21 | 1950 | NA |
| Communications | L-1 | 1950 | NA |
| Communications | L-2 | 1950 | NA |
| Communications | L-3 | 1950 | NA |
| Communications | L-4 | 1950 | NA |
| Communications | L-5 | 1950 | NA |
| Communications | L-6 | 1950 | NA |
| Communications | R-4 | 1950 | NA |
| Communications | R-5 | 1950 | NA |
| Communications | R-6 | 1950 | NA |
| Very Heavy Bombers | B-29 | 1951 | NA |
| Heavy Bombers | B-17 | 1951 | NA |
| Heavy Bombers | B-24 | 1951 | NA |
| Heavy Bombers | B-32 | 1951 | NA |
| Medium Bombers | B-25 | 1951 | NA |
| Medium Bombers | B-26 | 1951 | NA |
| Light Bombers | A-20 | 1951 | NA |
| Light Bombers | A-26 | 1951 | NA |
| Light Bombers | A-28 | 1951 | NA |
| Light Bombers | A-29 | 1951 | NA |
| Light Bombers | A-30 | 1951 | NA |
| Fighters | P-38 | 1951 | NA |
| Fighters | P-39 | 1951 | NA |
| Fighters | P-40 | 1951 | NA |
| Fighters | P-47 | 1951 | NA |
| Fighters | P-51 | 1951 | NA |
| Fighters | P-59 | 1951 | NA |
| Fighters | P-61 | 1951 | NA |
| Fighters | P-63 | 1951 | NA |
| Fighters | P-70 | 1951 | NA |
| Fighters | P-80 | 1951 | NA |
| Reconnaissance | OA-10 | 1951 | NA |
| Transports | C-43 | 1951 | NA |
| Transports | C-45 | 1951 | NA |
| Transports | C-46 | 1951 | NA |
| Transports | C-47 | 1951 | NA |
| Transports | C-53 | 1951 | NA |
| Transports | C-54 | 1951 | NA |
| Transports | C-60 | 1951 | NA |
| Transports | C-61 | 1951 | NA |
| Transports | UC-64 | 1951 | NA |
| Transports | C-69 | 1951 | NA |
| Transports | C-74 | 1951 | NA |
| Transports | C-78 | 1951 | NA |
| Transports | C-82 | 1951 | NA |
| Transports | C-87 | 1951 | NA |
| Trainers | PT-13 | 1951 | NA |
| Trainers | PT-19 | 1951 | NA |
| Trainers | BT-13 | 1951 | NA |
| Trainers | AT-6 | 1951 | NA |
| Trainers | AT-7 | 1951 | NA |
| Trainers | AT-8 | 1951 | NA |
| Trainers | AT-9 | 1951 | NA |
| Trainers | AT-10 | 1951 | NA |
| Trainers | AT-16 | 1951 | NA |
| Trainers | AT-19 | 1951 | NA |
| Trainers | AT-21 | 1951 | NA |
| Communications | L-1 | 1951 | NA |
| Communications | L-2 | 1951 | NA |
| Communications | L-3 | 1951 | NA |
| Communications | L-4 | 1951 | NA |
| Communications | L-5 | 1951 | NA |
| Communications | L-6 | 1951 | NA |
| Communications | R-4 | 1951 | NA |
| Communications | R-5 | 1951 | NA |
| Communications | R-6 | 1951 | NA |
To beging with the short analysis, lets filter the cost of planes over the time. In this case, since there are too many planes to be graph and most of the with information missing, I am going to display Fighter planes which are more complete.
planes_cost <- ww2_cl %>%
filter(.$Type == "Fighters" & !is.na(.$Price) )
planes_cost %>%
kable() %>%
kable_styling() %>%
scroll_box(width = "100%",height = "320px")
| Type | Model | Year | Price |
|---|---|---|---|
| Fighters | P-38 | 1941 | 132 |
| Fighters | P-39 | 1941 | 77 |
| Fighters | P-40 | 1941 | 60 |
| Fighters | P-47 | 1941 | 113 |
| Fighters | P-61 | 1941 | 649 |
| Fighters | P-70 | 1941 | 143 |
| Fighters | P-38 | 1942 | 284 |
| Fighters | P-39 | 1942 | 159 |
| Fighters | P-40 | 1942 | 562 |
| Fighters | P-47 | 1942 | 246 |
| Fighters | P-51 | 1942 | 58 |
| Fighters | P-61 | 1942 | 584 |
| Fighters | P-63 | 1942 | 60 |
| Fighters | P-70 | 1942 | 76 |
| Fighters | P-38 | 1943 | 120 |
| Fighters | P-39 | 1943 | 69 |
| Fighters | P-40 | 1943 | 59 |
| Fighters | P-47 | 1943 | 105 |
| Fighters | P-51 | 1943 | 698 |
| Fighters | P-61 | 1943 | 245 |
| Fighters | P-63 | 1943 | 277 |
| Fighters | P-38 | 1944 | 407 |
| Fighters | P-39 | 1944 | 534 |
| Fighters | P-40 | 1944 | 444 |
| Fighters | P-47 | 1944 | 594 |
| Fighters | P-51 | 1944 | 58 |
| Fighters | P-59 | 1944 | 236 |
| Fighters | P-61 | 1944 | 327 |
| Fighters | P-63 | 1944 | 57 |
| Fighters | P-80 | 1944 | 109 |
| Fighters | P-38 | 1945 | 105 |
| Fighters | P-40 | 1945 | 49 |
| Fighters | P-47 | 1945 | 104 |
| Fighters | P-51 | 1945 | 824 |
| Fighters | P-59 | 1945 | 299 |
| Fighters | P-61 | 1945 | 180 |
| Fighters | P-63 | 1945 | 379 |
| Fighters | P-80 | 1945 | 471 |
| Fighters | P-38 | 1946 | 567 |
| Fighters | P-39 | 1946 | 50 |
| Fighters | P-40 | 1946 | 449 |
| Fighters | P-47 | 1946 | 258 |
| Fighters | P-51 | 1946 | 51 |
| Fighters | P-61 | 1946 | 711 |
| Fighters | P-63 | 1946 | 59 |
| Fighters | P-80 | 1946 | 71 |
| Fighters | P-38 | 1947 | 97 |
| Fighters | P-39 | 1947 | 666 |
| Fighters | P-40 | 1947 | 44 |
| Fighters | P-47 | 1947 | 85 |
| Fighters | P-51 | 1947 | 572 |
| Fighters | P-63 | 1947 | 966 |
| Fighters | P-80 | 1947 | 840 |
| Fighters | P-38 | 1948 | 147 |
| Fighters | P-40 | 1948 | 892 |
| Fighters | P-47 | 1948 | 578 |
| Fighters | P-51 | 1948 | 50 |
| Fighters | P-61 | 1948 | 199 |
| Fighters | P-63 | 1948 | 65 |
| Fighters | P-47 | 1949 | 83 |
| Fighters | P-51 | 1949 | 985 |
| Fighters | P-61 | 1949 | 598 |
| Fighters | P-63 | 1949 | 914 |
| Fighters | P-47 | 1950 | 83 |
ggplot(data = planes_cost,aes(x = Year, y = as.numeric(Price)*1000,group = Model, color = Model))+geom_line(stat = "identity",size=1.6)+theme_get()+theme(plot.title = element_text(hjust = 0.5),text=element_text(size=13, family="Times"))+ggtitle("Cost of WW2 Fighters")+ylab("Cost ($K)")+xlab("Year")
As shown in the graph, plane models increased and decreased their price over time. Planes like P-61 (Light Blue Color) decreased its production prize since 1941 to 1943.Its production increased drastically from 1945 to 1946 and decreased exponentially until 1948.
Now lets check the summary statistics for the price of planes from 1941 to 1950 time frame.
planes_cost$Price %>% as.numeric() %>% summary()*1000
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 44000 76750 189500 313000 563200 985000
As shown in the summary, the most expensive plane to produce costed 985,000$ dollars at that time wheras the average price was about 189500\(. The minimun cost for a fighter plane was 44000\).
ggplot(data = planes_cost,aes(x = Year, y = as.numeric(Price)*1000))+geom_boxplot()+theme_get()+theme(plot.title = element_text(hjust = 0.5),text=element_text(size=13, family="Times"))+ggtitle("Cost of WW2 Fighters")+ylab("Cost ($K)")+xlab("Year")
As shown in the graph above, the higest production of fighter planes was carried out in 1947, 1949 with most of them being cheaper than the rest. On the other hand, years 1943, 1946 and 1948 produced more expensive planes according to the production for that year. Year 1950 should be ommited because there is only one observation.
As shown in the graph above,the production of planes varied over the years. The decrease in the cost of production of planes over the time may be due to mass production required to fulfill the requeriments for the time war whereas the exponential increase in the price of such planes correlates with the fact that due to war certain resurces were more expensive and therefore, more costly to produce.