Created
July 15, 2018 05:26
-
-
Save AhsanSN/02f263143c41cf94270a5f8e9dee79c2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> library(dplyr) | |
> library(ggplot2) | |
> library(statsr) | |
> data(nycflights) | |
//ggplot | |
> ggplot(data = nycflights, aes(x= dep_delay)) +geom_histogram() | |
//mean | |
> nycflights %>% summarise(mean_dd = mean(dep_delay)) | |
//median | |
> nycflights %>% summarise(mean_dd = median(dep_delay)) | |
//boxplot | |
> ggplot(data = nycflights, aes(x="",y= dep_delay)) +geom_boxplot() | |
//comparision between months | |
> ggplot(data = nycflights, aes(x=factor(month),y= dep_delay)) +geom_boxplot() | |
//mean of each month [piping] | |
> nycflights %>% group_by(month) %>% summarise(median_dd = mean(dep_delay)) %>% arrange(desc(median_dd)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment