0

Here is the part of my code to make the chart : enter image description here

del_time = ATL %>% 
  group_by(arrivaltime) %>%
  summarise(tot_flg = n(), tot_arrdelay = sum(arr_delay, na.rm = T),
            prop_arrdelay = tot_arrdelay/tot_flg,
            tot_depdelay = sum(dep_delay, na.rm = T),
            prop_depdelay = tot_depdelay/tot_flg)

And from here, I am trying to plot the graph, but I am now sure how to do it. Since it is in the frame and I am choosing the specific column, I am a bit confused. I do not want NA value to be in my graph as well.

  1. plot graph arrivaltime vs. prop_arrdelay
  2. plot graph arrivaltime vs. tot_arrdelay and prop_arrdelay
  3. plot graph that each is the elements from the arrival time; morning, evening, night early which have x-axis tot_arrdelay and y-axis prop_arrdelay

How do you plot graphs that I want from here? Thank you!!

Wahyu Kristianto
  • 8,719
  • 6
  • 43
  • 68
loms
  • 11
  • 2
  • 1
    This is quite an open question, but to get more useful help you might consider following the suggestions [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5965451#5965451) to get more useful help from the SO community. If you're using dplyr already, you might want to consider plotting using [ggplot2](https://ggplot2.tidyverse.org/). – SDS0 Nov 21 '19 at 12:25
  • @SDS0 I am not familiar with R at all, and I am now sure how to get rid of NA row and then plot the graph for specific columns.. Can you please help? – loms Nov 21 '19 at 12:32
  • @Ioms you can add %>% filter(complete.cases(.)) to your pipeline to remove rows with any NA in them. The rest of your question is realyl a bit too broad though. Please look at the links I gave you to how to provide a reproducible R example, and to the ggplot2 package, which you could use to do your plots. – SDS0 Nov 21 '19 at 12:58

0 Answers0