forked from udacity/pdsnd_github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBikeShare.rmd
More file actions
167 lines (111 loc) · 2.92 KB
/
BikeShare.rmd
File metadata and controls
167 lines (111 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
Project for the R programming section
========================================================
***
### Read data
```{r Get data}
ch <- read.csv("C:/Users/BELHABICH/Desktop/Yacine/1 Entrepreunariat/1 Analytics Business Consulting/5 Training/1 Tech leaders AAL/1 Udacity Support/2 R PROGRAMMING/5 Project/chicago.csv")
ny <- read.csv("C:/Users/BELHABICH/Desktop/Yacine/1 Entrepreunariat/1 Analytics Business Consulting/5 Training/1 Tech leaders AAL/1 Udacity Support/2 R PROGRAMMING/5 Project/new-york-city.csv")
wash <- read.csv("C:/Users/BELHABICH/Desktop/Yacine/1 Entrepreunariat/1 Analytics Business Consulting/5 Training/1 Tech leaders AAL/1 Udacity Support/2 R PROGRAMMING/5 Project/washington.csv")
```
# Load packages
```{r Packages}
library(tidyverse)
library(ggplot2)
```
# Discovering chicago data
```{r }
glimpse(ch)
names(ch)
```
```{r }
glimpse(ny)
names(ny)
```
***
```{r }
glimpse(wash)
names(wash)
```
***
```{r }
names(ny)
```
```{r }
names(wash)
```
```{r }
names(ch)
```
#1 Popular times of travel (i.e., occurs most often in the start time)
***
```{r }
ny3 <- ny2 %>%
group_by(Gender) %>%
summarise(Average_duration = round(mean(Trip.Duration), 2),
Media_duration = round(median(Trip.Duration), 2),
SD_duration = round(sd(Trip.Duration), 2)
)
ny3
```
***
```{r }
ggplot(ny2, aes(x = Trip.Duration)) +
xlim(0, 3500) +
geom_density()+
ggtitle("Male-Female comparaison according to trip duration") +
labs(x = "Trip duration", y = "Trip duration's Density")+
facet_wrap(~Gender )
```
```{r }
chi3 <- chi2 %>%
group_by(Gender) %>%
summarise(Average_duration = round(mean(Trip.Duration), 2),
Media_duration = round(median(Trip.Duration), 2),
SD_duration = round(sd(Trip.Duration), 2)
)
chi3
```
```{r }
ggplot(chi2, aes(x = Trip.Duration)) +
xlim(0, 3500) +
geom_density()+
ggtitle("Male-Female comparaison according to trip duration") +
labs(x = "Trip duration", y = "Trip duration's Density")+
facet_wrap(~Gender )
```
```{r }
library(tidyverse)
```
What is the most common day of week?
What is the most common hour of day?
#2 Popular stations and trip
What is the most common start station?
What is the most common end station?
What is the most common trip from start to end (i.e., most frequent combination of start station and end station)?
#3 Trip duration
What is the total travel time for users in different cities?
What is the average travel time for users in different cities?
#4 User info
What are the counts of each user type?
What are the counts of each gender (only available for NYC and Chicago)?
What are the earliest, most recent, most common year of birth (only available for NYC and Chicago)?
***
```{r Scatterplots}
```
***
***
```{r Scatterplots}
```
***
***
```{r Scatterplots}
```
***
***
```{r Scatterplots}
```
***
***
```{r Scatterplots}
```
***